/*! * jQuery Tiny Pub/Sub - v0.6 - 1/10/2011 * http://benalman.com/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ //Modernizr is available under the MIT license /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE * @version 2.3.0 */ /** * @license * Lo-Dash 2.4.1 (Custom Build) * Build: `lodash include="debounce"` * Copyright 2012-2013 The Dojo Foundation * Based on Underscore.js 1.5.2 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /*! grunt-grunticon Stylesheet Loader - v2.1.6 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */ /*! * jQuery-ajaxTransport-XDomainRequest - v1.0.4 - 2015-03-05 * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest * Copyright (c) 2015 Jason Moon (@JSONMOON) * Licensed MIT (/blob/master/LICENSE.txt) */ define("module/bootstrappedJquery",["jquery"],function(e){return e.ajaxSetup({cache:!0}),e}),define("vendor/events/pubsub",["jquery"],function(e){var t=e({});e.eventHistory=[],e.on=function(n,o){function i(){return o.apply(this,Array.prototype.slice.call(arguments,1))}i.guid=o.guid=o.guid||(e.guid?e.guid++:e.event.guid++),t.on(n,i)},e.off=function(){t.off.apply(t,arguments)},e.emit=function(){e.eventHistory.push(arguments[0]),t.trigger.apply(t,arguments)}}),define("module/globalPubsub",["module/bootstrappedJquery","vendor/events/pubsub"],function(e){return e}),define("module/bootstrap",["config","module/bootstrappedJquery","module/globalPubsub"],function(e,t,n){return{pubsub:n,$:t,config:e,window:window}}),define("module/translator",[],function(){function e(e,o){if(!e)throw n.TRANSLATION_UNDEFINED;if(!t(e))throw n.TRANSLATION_NOT_AN_OBJECT;this.translation=e,this.locale=o||"en-GB"}var t=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n={TRANSLATION_UNDEFINED:"Translator Error : Translator expects a translation object as its first parameter",TRANSLATION_NOT_AN_OBJECT:"Translator Error : Translator expects an object literal as its first parameter"};return e.prototype.get=function(e){return this.translation[e]?this.translation[e]:null},e.prototype.getLocale=function(){return this.locale},e}),define("translator",["module/translator","config","translation"],function(e,t,n){return new e(n,t.locale)}),define("module/ajaxForm/ajaxForm",["module/bootstrap","config","translator"],function(e,t,n){var o=e.$,i=function(){this.errorMessage=n.get("thereWasAProblem");var t=this;e.pubsub.on("ajaxForm:submit",function(e,n){t.submit(e,n)})};return i.prototype.submit=function(t,n){e.pubsub.emit("ajaxForm:renderWait"),o.ajax({url:n+".json",dataType:"json",type:"POST",data:t,success:function(t){var n=t.body;switch(t.reply){case"success":e.pubsub.emit("ajaxForm:success",[n]);break;case"feedback":e.pubsub.emit("ajaxForm:feedback",[n]);break;default:e.pubsub.emit("ajaxForm:error",[n])}},error:o.proxy(function(t){e.pubsub.emit("ajaxForm:error",[this.errorMessage,t])},this)})},i}),define("module/ajaxForm/ajaxFormView",["module/bootstrap","translator"],function(e,t){function n(n){this.translator=t,this.elm=e.$(n),this.url=this.elm.attr("action"),this.fields=e.$("input, textarea",this.elm),this.attach()}return n.prototype={attach:function(){var t=this;this.elm.on("submit",function(e){e.preventDefault(),t.send()});var n=function(t){var n=e.$(t).parent(),o=""!==e.$(t).val();n.toggleClass("input-has-content",o)},o=function(t){var o=t.target;if(e.$(o).prop("nodeName").match(/(INPUT|TEXTAREA)/)){var i="focus"===t.type.toLowerCase()?"add":"remove";e.$(o).parent().toggleClass("input-has-focus",i),n(o)}};return this.fields.on("focus",o),this.fields.on("blur",o),this.fields.on("keyup",function(t){var o=t.target;e.$(o).prop("nodeName").match(/(INPUT|TEXTAREA)/)&&n(o)}),e.pubsub.on("ajaxForm:success",function(n){t.elm.removeClass("feedback"),t.elm.addClass("successful-submit"),t.elm.before('

'+n+'

"),e.$("#successMsg button").on("click",function(){e.pubsub.emit("ajaxForm:showForm")})}),e.pubsub.on("ajaxForm:feedback",function(o){e.$("p.feedback",this.elm).remove(),t.elm.addClass("feedback"),e.pubsub.emit("ajaxForm:stopWait"),e.$(t.fields).each(function(t,i){var s=e.$(i).attr("name"),a=e.$(i).val().trim();void 0!==o[s]&&(e.$(i).val(a),e.$(i).parent().addClass("invalid"),n(i),e.$(i.parentNode).append('"))})}),e.pubsub.on("ajaxForm:error",function(n,o){t.elm.removeClass("feedback"),t.elm.addClass("error"),e.pubsub.emit("ajaxForm:stopWait"),t.elm.before('

'+n+"

"),e.$("#errorMsg button").on("click",function(){t.send()})}),e.pubsub.on("ajaxForm:showForm",function(){e.$("#"+t.elm.attr("id")+" fieldset p").remove(),t.fields.each(function(t,o){e.$(o).val(""),n(o)}),t.elm.removeClass("successful-submit").removeClass("error"),e.$("#successMsg, #errorMsg").remove()}),e.pubsub.on("ajaxForm:stopWait",function(){t.elm.removeClass("wait"),e.$(".spin",t.elm).remove()}),e.pubsub.on("ajaxForm:renderWait",function(){t.elm.addClass("wait"),e.$("fieldset",t.elm).removeClass("invalid"),e.$("#successMsg, #errorMsg").remove(),t.elm.append('
')}),this},send:function(){var t=[];this.fields.each(function(n,o){var i=e.$(o);t.push(i.attr("name")+"="+i.val())}),e.pubsub.emit("ajaxForm:submit",[t.join("&"),this.url])}},n}),define("module/featureDetector",["config"],function(e){function t(e){var t=/forceTouchSupport=(on|off)/.exec(window.location.search);return!(!t||!t[1])&&t[1]===e}function n(e,t){return o.hasOwnProperty(t)||(o[t]=l[e+t]?l[e+t]():void 0),o[t]}var o={},i=/OS ([0-9])/,s=document.documentElement,a="modernizr",r=document.createElement(a),c=r.style,l={isIos:function(){return/(iPod|iPad|iPhone)/.test(navigator.userAgent)},isIosVersion:function(e){var t=i.exec(navigator.userAgent);return!(!t||!t[1])&&Number(t[1])>=e},isIos4:function(){return this.isIosVersion(4)},isAndroid:function(){return/Android/i.test(navigator.userAgent)},isAndroidMobile2:function(){return this.isAndroid()&&/Mobile/i.test(navigator.userAgent)&&/Android 2./.test(navigator.userAgent)},isAndroidMobile22:function(){return this.isAndroid()&&/Mobile/i.test(navigator.userAgent)&&/2.2/.test(navigator.userAgent)},isIE10:function(){return/MSIE 10/.test(navigator.userAgent)},isWindowsPhone:function(){return/Windows Phone/.test(navigator.userAgent)},isChrome:function(){return/Chrome/.test(navigator.userAgent)},canUseHistoryApi:function(){return window.history&&window.history.pushState},isContinuousPlayEnabled:function(){return!!document.getElementById("gnlContinuousPlayEnabled")||!!document.getElementById("continuous-play-enabled")},isShowingDesktopAds:function(){return!!document.getElementById("advert-post-script-load")},isOrbFig:function(){return"undefined"!=typeof orb&&"function"==typeof orb.fig},isCollectingGNLAnalytics:function(){return!!document.getElementById("gnlAnalyticsEnabled")},isDisplayingGnlAds:function(){return!!document.getElementById("gnlAdsEnabled")},isFromUK:function(){var e=void 0!==orb.fig.geo&&"function"==typeof orb.fig.geo.isUK;return this.isOrbFig()&&e?orb.fig.geo.isUK():void 0},canPlayProgressiveDownload:function(){return!("topcat"!==e.configuration.cms||this.isDesktop()||!0===e.asset.isLiveAvStream||this.isIos()&&"audio"!==e.asset.mediaType)},_contains:function(e,t){return!!~(""+e).indexOf(t)},_injectElementWithStyles:function(e,t,n,o){var i,r,c,l,u=document.createElement("div"),d=document.body,h=d||document.createElement("body");if(parseInt(n,10))for(;n--;)c=document.createElement("div"),c.id=o?o[n]:a+(n+1),u.appendChild(c);return i=["­",'"].join(""),u.id=a,(d?u:h).innerHTML+=i,h.appendChild(u),d||(h.style.background="",h.style.overflow="hidden",l=s.style.overflow,s.style.overflow="hidden",s.appendChild(h)),r=t(u,e),d?u.parentNode.removeChild(u):(h.parentNode.removeChild(h),s.style.overflow=l),!!r},_testProps:function(e,t){for(var n in e){var o=e[n];if(!this._contains(o,"-")&&void 0!==c[o])return"pfx"!==t||o}return!1},_testPropsAll:function(e,t,n){var o="Webkit Moz O ms",i=o.split(" "),s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+i.join(s+" ")+s).split(" ");return this._testProps(a,t)},canCssColumn:function(){return!!this._testPropsAll("columnCount")},canCssTransition:function(){return!!this._testPropsAll("transition")},whichTransitionEnd:function(){var e=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var n in t)if(void 0!==e.style[n])return t[n]},canCssTransform:function(){return!!this._testPropsAll("transform")},canCssPreserve3d:function(){if(!this.canCssTransform())return!1;var e=!!this._testPropsAll("transformStyle");return e&&this._injectElementWithStyles("#modernizr { transform-style: preserve-3d; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -o-transform-style: preserve-3d; }",function(t,n){if(!window.getComputedStyle)return!1;var o=window.getComputedStyle(t),i="preserve-3d"===o.getPropertyValue("-webkit-transform-style"),s="preserve-3d"===o.getPropertyValue("-moz-transform-style"),a="preserve-3d"===o.getPropertyValue("-o-transform-style"),r="preserve-3d"===o.getPropertyValue("transform-style");e=r||a||s||i}),e},canCssTransform3d:function(){var e=!!this._testPropsAll("perspective");return e&&"webkitPerspective"in s.style&&this._injectElementWithStyles("@media (transform-3d), (-webkit-transform-3d) { #modernizr{ left: 9px; position: absolute; height: 3px; }}",function(t,n){e=9===t.offsetLeft&&3===t.offsetHeight}),e},canTouchEvents:function(){return"ontouchstart"in window},canSVG:function(){return!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect},isDesktop:function(){return this.isLargeScreen()&&!this.isTouchDevice()},isTouchDevice:function(){return!t("off")&&!!(t("on")||this.canTouchEvents()||window.navigator.msMaxTouchPoints>0||window.DocumentTouch&&document instanceof DocumentTouch)},isLargeScreen:function(){return(window.innerWidth>0?window.innerWidth:screen.width)>1024},_isWsChannelPage:function(){return e.isChannelPage&&"topcat"===e.configuration.cms},isApple:function(){return/(Macintosh|Mac_PowerPC)/.test(navigator.userAgent)||this.isIos()},isWindows:function(){return/(Windows)/.test(navigator.userAgent)},isSafari:function(){return/(Safari)/.test(navigator.userAgent)&&!/(Chrome)/.test(navigator.userAgent)},isIE:function(){return/(MSIE|WOW64|IEMobile)/.test(navigator.userAgent)},isFirefox:function(){return/(Firefox)/.test(navigator.userAgent)},isFacebookBrowser:function(){return/(FBAN|FBAV)/.test(navigator.userAgent)},isAndroidBrowser:function(){return/(Android|Mobile)/.test(navigator.userAgent)}};return{can:function(e){return n("can",e)},is:function(e){return n("is",e)},which:function(e){return n("which",e)},__cacheClear:function(){o={}}}}),define("module/deviceInspector",["module/bootstrap","module/featureDetector"],function(e,t){function n(){b.$(g).on("resize",i)}function o(){var e=v.documentElement.clientWidth,t=v.documentElement.clientHeight;return e>t?e:t}function i(e){var t=r(),n=c();t!==m&&l(t),n!==f&&u(n)}function s(){return v.documentElement.clientWidth}function a(){return t.is("TouchDevice")}function r(){var e=s(),t="group1";return e>=y&&e=w&&e<_?t="group3":e>=_&&(t="group4"),t}function c(){var e,t=o(),n=s();return(n=k&&t=k&&t>=x&&(e="tablet"),s()>=C&&!a()&&(e="wide"),e}function l(e){m=e,b.pubsub.emit("deviceGroup",[m])}function u(e){f=e,b.pubsub.emit("deviceType",[f])}function d(){return m}function h(){return f}function p(t,o){return g=t||window,b=o||e,m="group1",f="smart",v=g.document,l(r()),u(c()),n(),{getType:h,getGroup:d}}var m,f,g,v,b,y=400,w=600,_=1008,k=600,C=1008,x=720;return{init:p}}),define("deviceInspector",["module/deviceInspector"],function(e){return e.init()}),define("module/alternativeJsStrategy/processJsDependencies",[],function(){var e=function(e,t){require([e],function(e){e&&e.reProcess&&e.reProcess("#"+t)})};return function(t,n){for(var o in t)e(t[o],n)}}),define("module/polyfill/bind",[],function(){Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,o=function(){},i=function(){return n.apply(this instanceof o&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return o.prototype=this.prototype,i.prototype=new o,i})}),define("module/alternativeJsStrategy/postLoadHandlers/base",["module/bootstrap","module/alternativeJsStrategy/processJsDependencies","module/polyfill/bind"],function(e,t){var n=function(e){e&&(this.elementId=e.getAttribute("id"),this.element=e)};return n.prototype.load=function(){e.$.ajax({url:this.url,dataType:"json",success:this.processSuccessfulResponse.bind(this)})},n.prototype.processJsDependencies=function(e){t(e,this.elementId)},n}),define("module/alternativeJsStrategy/postLoadHandlers/single",["module/bootstrap","module/alternativeJsStrategy/postLoadHandlers/base","module/polyfill/bind"],function(e,t){var n=function(e,n){1===e.getElementsByClassName("show-more-container").length?this.hasShowMoreButton=!0:this.postLoaded=!0,this.url=n,t.call(this,e)};return n.prototype=new t,n.prototype.loadIfShouldBeShown=function(){this.load()},n.prototype.addShowMoreButton=function(){require(["module/alternativeJsStrategy/moreButton"],function(e){new e(this.elementId,this.url)}.bind(this))},n.prototype.processSuccessfulResponse=function(t){if(t.html)for(this.element.innerHTML=t.html;this.element.attributes.length>0;)this.element.removeAttribute(this.element.attributes[0].name);t.moreContentUrl&&!this.hasShowMoreButton&&(this.url=t.moreContentUrl,this.addShowMoreButton()),this.processJsDependencies(t.jsDependencies),e.pubsub.emit("component:postloaded",this.element)},n}),define("module/alternativeJsStrategy/postLoadHandlers/legacySingle",["config","module/alternativeJsStrategy/postLoadHandlers/base","module/bootstrap"],function(e,t,n){var o=function(o,i,s){var a,r,c={};if(i.opts){if(i.opts.bespoke_old_post_load){for(var l in i.opts.js_dependencies)i.opts.js_dependencies[l]="module/"+i.opts.js_dependencies[l];return void(this.bespokeJsOnly=i.opts.js_dependencies)}i.opts.loading_strategy&&(this.postLoaded=this.isPostLoaded(i),i.opts.loading_strategy="include_content"),i.opts.bespoke_post_load_handler&&(this.bespokePostLoadHandler=i.opts.bespoke_post_load_handler)}"remote-portlet"===i.type&&"on"===i.opts.js&&(i.selector="#"+i.id,this.remotePortletMeta=i),c.id=i.id,c.opts=i.opts,i.template&&(c.template=i.template),i.deviceGroups&&(this.visibleDeviceGroups=i.deviceGroups,c.deviceGroups=i.deviceGroups,this.shouldShow(s)?this.isToggleable=!0:this.delayedLoading=!0),a=i.type||i.name,r={batch:{}},r.batch[a]=c,this.url=e.pathPrefix+(e.languageVariant?"/"+e.languageVariant:"")+"/components?alternativeJsLoading=true&"+n.$.param(r),t.call(this,o)};return o.prototype=new t,o.prototype.loadRemotePortletDependency=function(e){var t=e.opts.js_dependency?e.opts.js_dependency:e.opts.id;require(["module/components/"+t],function(t){t.init(e)})},o.prototype.isPostLoaded=function(e){return"post_load"===e.opts.loading_strategy},o.prototype.addShowMoreButton=function(){require(["module/components/moreButton"],function(e){new e(this.elementId,this.url)}.bind(this))},o.prototype.processSuccessfulResponse=function(e){if(this.bespokePostLoadHandler)return void require([this.bespokePostLoadHandler],function(t){t.handleSuccess(this,e);for(var o in e)n.pubsub.emit("component:postloaded",document.getElementById(o))}.bind(this));for(var t in e)this.element.outerHTML=e[t].html,n.pubsub.emit("component:postloaded",document.getElementById(this.elementId)),this.remotePortletMeta?this.loadRemotePortletDependency(this.remotePortletMeta):this.processJsDependencies(e[t].jsDependencies)},o.prototype.shouldShow=function(e){return!this.visibleDeviceGroups||this.visibleDeviceGroups&&-1!==this.visibleDeviceGroups.indexOf(e)},o.prototype.loadIfShouldBeShown=function(e){this.shouldShow(e)&&this.load()},o.prototype.updateDeviceGroupVisibility=function(e){var t="#"+this.elementId;this.shouldShow(e)?n.$(t).removeClass("hidden"):n.$(t).addClass("hidden")},o.prototype.loadIfShouldBeVisible=function(e){return!!this.shouldShow(e)&&(this.load(),!0)},o}),define("module/alternativeJsStrategy/postLoadHandlers/batch",["module/bootstrap","module/alternativeJsStrategy/postLoadHandlers/base"],function(e,t){var n=function(e,n){this.url=n,t.call(this,e),this.load()};return n.prototype=new t,n.prototype.processSuccessfulResponse=function(t){for(var n in t){var o=document.getElementById(n);o&&(o.outerHTML=t[n].html),this.processJsDependencies(t[n].jsDependencies),e.pubsub.emit("component:postloaded",document.getElementById(n))}},n}),define("module/alternativeJsStrategy/loaderFactory",["module/alternativeJsStrategy/postLoadHandlers/single","module/alternativeJsStrategy/postLoadHandlers/legacySingle","module/alternativeJsStrategy/postLoadHandlers/batch"],function(e,t,n){return{build:function(o,i){return o.hasAttribute("data-post-load-url")?new e(o,o.getAttribute("data-post-load-url")):o.hasAttribute("data-comp-meta")?new t(o,JSON.parse(o.getAttribute("data-comp-meta")),i):o.hasAttribute("data-batch-load-url")?new n(o,o.getAttribute("data-batch-load-url")):void 0}}}),define("module/alternativeJsStrategy/controller",["deviceInspector","module/alternativeJsStrategy/loaderFactory","module/bootstrap","module/polyfill/bind"],function(e,t,n){var o=function(){function e(e){var t=/device--(?:feature|smart|tablet|wide)/,o=document.body.className.split(" "),i=o.length,s=-1;for(/^group\d$/.test(e)&&(t=/device--group/);++s','','{{label}}','',"",""].join(""),i={loading:"show-more--loading"},s=function(e){return e?{normal:t.get("moreInfo"),loading:t.get("loading")}:{normal:t.get("streamShowMoreButton"),loading:t.get("loading")}};return function(e){var t=s(e),a=n(o.replace("{{label}}",t.normal)),r=a.find(".show-more__label"),c=n({});return a.on("click",function(e){c.trigger("click")}),{appendTo:function(e){a.appendTo(e)},element:a[0],remove:function(){a.detach()},on:function(e,t){c.on(e,t)},setNormal:function(){r.text(t.normal),a.removeClass(i.loading)},setLoading:function(){r.text(t.loading),a.addClass(i.loading)}}}}),define("module/alternativeJsStrategy/moreButton",["module/bootstrap","module/featureDetector","module/stream/endpoint","module/alternativeJsStrategy/processJsDependencies","module/stream/show_more_button"],function(e,t,n,o,i){t.can("CssTransition")&&e.$("body").addClass("css-anim");var s=function(t,o){var s=document.getElementById(t),a=e.$({});this.contentContainer=s.querySelector(".show-more-container"),this.$contentContainer=e.$(this.contentContainer),this.elementId=t,this.endpoint=new n(o,a,"more-button","json"),this.button=new i(!0),a.on("more-button:requesting",this.handleRequesting.bind(this)),a.on("more-button:html-with-js",this.handleNewContent.bind(this)),a.on("more-button:noupdates",this.button.remove.bind(this)),a.on("more-button:error",this.button.remove.bind(this)),this.button.on("click",this.handleShowMoreClick.bind(this)),this.button.appendTo(s)};return s.prototype.handleShowMoreClick=function(){this.endpoint.request()},s.prototype.handleRequesting=function(){this.button.setLoading()},s.prototype.handleNewContent=function(e,t){var n=document.createElement("div");n.innerHTML=t.html;var i=n.querySelector("a");this.$contentContainer.append(n.childNodes),i.focus(),t.moreContentUrl?(this.endpoint.setUrl(t.moreContentUrl),this.button.setNormal()):this.button.remove(),o(t.jsDependencies,this.elementId)},s}),define("module/assortedUtils",[],function(){function e(e){var t;try{t=JSON.parse(e)}catch(e){}return t}function t(e,t,n){for(var o=0;o-1},t.prototype.isOptedIn=function(){return e.readCookie(this.cookieName).indexOf(this.optInValue)>-1},t.prototype.isDismissed=function(){return e.readCookie(this.cookieName).indexOf(this.dismissedValue)>-1},t.prototype.isSurveyTaken=function(){return e.readCookie(this.cookieName).indexOf(this.surveyTakenValue)>-1},t.prototype.optIn=function(){this.isOptedIn()||e.appendToCookie(this.cookieName,this.optInValue,this.cookieExpiryInDays),this.isOptedOut()&&e.removeFromCookie(this.cookieName,this.optOutValue,this.cookieExpiryInDays)},t.prototype.optOut=function(){this.isOptedOut()||e.appendToCookie(this.cookieName,this.optOutValue,this.cookieExpiryInDays),this.isOptedIn()&&e.removeFromCookie(this.cookieName,this.optInValue,this.cookieExpiryInDays)},t.prototype.setSurveyTakenCookie=function(){e.appendToCookie(this.cookieName,this.surveyTakenValue,this.cookieExpiryInDays)},t.prototype.setBannerDismissedCookie=function(){e.appendToCookie(this.cookieName,this.dismissedValue,this.cookieExpiryInDays)},t.prototype.overrideDesktopCookie=function(t,n){e.setCookie(t,n,this.cookieExpiryInDays)},t.prototype.getBannerDismissedClass=function(){return this.isDismissed(this.cookieName,this.dismissedValue)?"":"news-banner--fixed"},t.prototype.getSurveyTakenClass=function(){return this.isSurveyTaken(this.cookieName,this.surveyTakenValue)?"news-banner__survey--hidden":""},t.prototype.removeFixedModifierFromBanner=function(){var e=$("#news-banner");e.hasClass("news-banner--fixed")&&e.removeClass("news-banner--fixed")},t.prototype.addOrbFooterPadding=function(){this.isDismissed(this.cookieName,this.dismissedValue)||(n=$("#orb-footer"),n.addClass("news-banner__orb-spacing"))},t.prototype.removeOrbFooterPadding=function(){n.hasClass("news-banner__orb-spacing")&&n.removeClass("news-banner__orb-spacing")},t.prototype.displayBanner=function(){var e=$("#news-banner__outer-container").detach();e=e.html().replace("{{explainerSurveyDisplay}}",this.getSurveyTakenClass()).replace("{{isExplainerBannerFixed}}",this.getBannerDismissedClass()),$("#page").append(e),this.addOrbFooterPadding()},t}),define("module/components/mediaPlayer/eventDelegator",["module/bootstrappedJquery"],function(e){function t(e,t,n){e.bind(t,function(o){var i=n?o:e;s.trigger(t,i),a.push({event:t,params:[void 0,i]})})}function n(e){t(e,"initialised"),t(e,"playing"),t(e,"pause"),t(e,"ended"),t(e,"error",!0)}function o(e,t){for(var n=0;n0){for(var n=0;n1){var i=this.normalisePartnerUrl(n+o);i&&(e.b_wspartner_url=i)}},s.prototype.getPartnerUrl=function(){var e=this.url.match(/\?(.+&)?wspartner=([^&?]+)/);if(null!==e){var t=e[2],n=document.createElement("a");return n.setAttribute("href",decodeURIComponent(t)),n}return null},s.prototype.getViewportWidth=function(){return u(window).width()},s.prototype.getViewportHeight=function(){return u(window).height()},s.prototype.getScreenRes=function(){return window.screen.width+"x"+window.screen.height},s.prototype.getVirtualSite=function(){return"virtual_site"in this.config.comscoreAnalytics?this.config.comscoreAnalytics.virtual_site:s.VIRTUAL_SITE_NONE},s.prototype.getEventType=function(){return s.EVENT_TYPE_PAGE_VIEW},s.prototype.getBusinessUnit=function(){return this.config.isWorldService?s.BUSINESS_UNIT_WS:s.BUSINESS_UNIT_NONE},s.prototype.getProjectSource=function(){return this.config.isWorldService?s.PROJECT_SOURCE_WS:s.PROJECT_SOURCE_NONE},s.prototype.getPageName=function(){return window.location.pathname.replace("/","").replace(/\//g,".")},s.prototype.getSyndicationPartner=function(){return"bbc|rd|"+o.getGroup()},s.prototype.getSectionId=function(){if(this.asset.section)return this.asset.section.id},s.prototype.getAssetHeadline=function(){return this.asset.headline?this.asset.headline:s.ASSET_HEADLINE_NONE},s.prototype.getAssetByline=function(){if(this.asset.byline)return this.asset.byline.name},s.prototype.getArticleLength=function(){return"number"==typeof this.asset.length?this.asset.length:null},s.prototype.getAdvertisingEnabled=function(){return this.asset.options&&this.asset.options.allowAdvertising?1:0},s.prototype.getSearchTerm=function(){return this.config.search?this.config.search.term:null},s.prototype.getSearchResults=function(){return this.config.search?this.config.search.results:null},s.prototype.getReferrer=function(){return document.referrer},s.prototype.getC7=function(){return window.location.href},s.prototype.getTitle=function(){return document.title},s.prototype.getCustomPageUrl=function(){return window.location.pathname!==this.asset.asset_uri?window.location.pathname:null},s.prototype.getCharacterEncoding=function(){return document.querySelector("meta[charset]").getAttribute("charset")},s.prototype.getTimestamp=function(){return Math.floor(+new Date/1e3)},s.prototype.getTopics=function(){return this.asset.topicTags},s.prototype.getBLink=function(e,t){return this.getBLinkComponents(e,t).map(function(e){return h(e)?"na":e}).join("|")},s.prototype.getBLinkComponents=function(e,t){return[t.promoted_channel||null,t.channel_location||null,t.module_name||null,t.link_type||null,t.link_name||null,t.link_position||null,t.links_in_module||null,t.link_info||null,t.section_location||null,t.page_type_location||null,t.link_placement||null,t.destination||null,e]},s.prototype.normalisePartnerUrl=function(e){return e=e.toLowerCase(),e=c(e),e=l(e),e=a(e)},s.prototype.isEmbedUrl=function(){return-1!==this.url.indexOf("/embed?")},s.prototype.processConfig=function(){for(var e=this.comscoreConfig.hidden||{},t=0;t0&&(p++,this.registerHiddenEventListeners(n))}},s.prototype.registerHiddenEventListeners=function(e){switch(e.type){case"twite":this.registerSingleHiddenEventListener(e,"twite__channel-link",this.shareToolLinkPosition(e));break;case"extractedtwite":this.registerSingleHiddenEventListener(e,"extracted__channel-link",this.shareToolLinkPosition(e))}},s.prototype.registerSingleHiddenEventListener=function(e,t,n){var o=this;n=n||0,document.getElementsByClassName(e.selector)[0].getElementsByClassName(t)[0].addEventListener("click",function(){o.onShareButtonClicked(e.name,n)},!1)},s.prototype.shareToolLinkPosition=function(e){for(var t=document.getElementsByClassName("sharetools")[0].getElementsByTagName("li")||0,n=1,o=0;o/g,">").replace(/"/g,""").replace(/'/g,"'")}var o=function(t){function n(){a.resizeImages([a.imageReplaceNodelist,a.backgroundImageReplaceNodelist])}var o=e.$;"string"==typeof t&&o(t).each(function(e,t){o(t).addClass("js-image-replace")}),this.widths=[96,130,165,200,235,270,304,340,375,410,445,485,520,555,590,624,625,660,695,736,768,772,800,834,872,904,936,950,976,1024,1536,2048],this.programmesWidths=[96,128,160,192,208,240,272,304,336,384,416,448,480,528,560,592,624,656,688,736,768,800,832,864,912,944,960,976,1024,1536,1920],this.isResizing=!1,this.imageReplaceNodelist=null,this.backgroundImageReplaceNodelist=null,this.upscale=!e.config.hasOwnProperty("imageUpscale")||e.config.imageUpscale,e.config.features2&&e.config.features2.hasOwnProperty("lazy_images")?this.lazyImages=e.config.features2.lazy_images:this.lazyImages=!0;var i=e.window.document.documentElement.clientHeight,s=i&&i>400?i/2:200;this.lazyBufferZone=e.config.hasOwnProperty("imageBuffer")?e.config.imageBuffer:s;var a=this;this.changeDivsToImgs(),e.pubsub.on("imageEnhancer:resize",n),e.pubsub.on("imageEnhancer:scroll",n),e.pubsub.on("component:loaded",function(){a.changeDivsToImgs(),a.initResizeImages()}),e.pubsub.on("component:postloaded",function(){a.changeDivsToImgs(),a.initResizeImages()}),setTimeout(function(){a.initResizeImages()},250)};return o.prototype={changeDivsToImgs:function(){$("div.js-delayed-image-load").each(function(e,t){t="number"!=typeof t?t:e;var o=t.getAttribute("data-width"),i=t.getAttribute("data-height"),s="";o>0&&i>0&&(s=' width="'+t.getAttribute("data-width")+'" height="'+t.getAttribute("data-height")+'"');var a=n(t.getAttribute("data-alt"));$(t).replaceWith(''+a+'")})},initResizeImages:function(){this.imageReplaceNodelist=$(".js-image-replace"),this.backgroundImageReplaceNodelist=$(".js-bg-image-replace"),this.resizeImages([this.imageReplaceNodelist,this.backgroundImageReplaceNodelist]),window.addEventListener?(window.addEventListener("resize",function(){e.pubsub.emit("imageEnhancer:resize")},!1),this.lazyImages&&this.addScrollEventListener()):window.attachEvent("resize",function(){e.pubsub.emit("imageEnhancer:resize")})},addScrollEventListener:function(){window.addEventListener("scroll",t.debounce(function(){e.pubsub.emit("imageEnhancer:scroll")},100),!1)},removeLoadingClass:function(){$(this).removeClass("responsive-image__img--loading")},resizeImages:function(e){if(!this.isResizing){this.isResizing=!0;for(var t=0,n=e.length;te.clientWidth},calcImgSrc:function(e,t){if(null==e)return!1;if(-1!==e.indexOf("cps-images-private"))return e;var n=e.match(/\/news\/(?:ws\/)?(\d*)/)||e;if(null===n||"string"==typeof n){var o=/\/images\/ic\/(\d+)x(\d+)/,i=e.match(o);if(null===i)return!1;var s=parseInt(i[1],10),a=parseInt(i[2],10),r=this.matchBestProgrammesWidth(t),c=r/s,l=Math.round(a*c),u="/images/ic/"+r+"x"+l;return e.replace(o,u)}var d=e.indexOf(n[1]),h=n[1].length;return e.substr(0,d)+this.matchBestWidth(t)+e.substr(d+h)},matchBestProgrammesWidth:function(e){return this.matchBestWidth(e,this.programmesWidths)},matchBestWidth:function(e,t){t=t||this.widths;for(var n=t.length,o=t[n-1];n--;)t[n]=e&&(o=t[n]);return o},isBelowFold:function(e,t){var n=e.height()-1+e.scrollTop();return t.offset().top>n+this.lazyBufferZone}},o}),define("module/components/mediaPlayer/settingsBuilder",["module/components/mediaPlayer/comscoreSettings","module/components/mediaPlayer/playlistSelector","module/components/mediaPlayer/autoPlay","module/assortedUtils","module/featureDetector","module/imageenhancer","istats-1","module/bootstrap"],function(e,t,n,o,i,s,a,r){function c(o){var s=u(h),r=o.otherSettings||{};if(d.extend(!0,s,o.settings,e.get()),s.counterName||(s.counterName=a.getCountername()),s.autoplay=n.isEnabled(o),s.playlistObject){var c=s.playlistObject;r.advertisingAllowed&&i.is("DisplayingGnlAds")&&c.items.unshift({kind:"advert"}),c.holdingImageURL||(c.holdingImageURL=l(r.unProcessedImageUrl,r.placeholderWidth))}else if(r.playlist){var p=r.playlist;s.playlist=t.selectPlaylist(p),p.overrideHoldingImage&&(s.overrideHoldingImage=l(p.overrideHoldingImage,r.placeholderWidth))}return s}function l(e,t){return e}var u=(o.forEach,o.objectCreate),d=(o.mergeObject,new s,r.$),h={appName:"news",appType:"responsive",product:"news",responsive:!0,waitOnPluginLoad:!0,superResponsive:!0,ui:{subtitles:{enabled:!0,defaultOn:!0}}};return{fromPlayable:c}}),define("module/components/mediaPlayer/main",["module/assortedUtils","module/components/mediaPlayer/eventDelegator","module/components/mediaPlayer/flashPlayerHandler","module/components/mediaPlayer/pluginLoader","module/components/mediaPlayer/settingsBuilder","module/components/mediaPlayer/view","module/globalPubsub","vendor/polyfill/promise","require"],function(e,t,n,o,i,s,a,r,c){function l(){return new w(function(e){c(["bump-3"],function(t){e(t)})})}function u(e,n,s){var a,r=i.fromPlayable(s);l().then(function(i){return a=i(e).player(r),t.addPlayer(a),a.bind("fullscreenExit",function(t){e.style.paddingBottom="0",setTimeout(function(){e.style.paddingBottom="56.25%"},100)}),o({instance:a,domId:n})}).then(function(){a.load()})}function d(e){a.emit("player:initialised",[e])}function h(e,t){n.handleNewPlayer(t),d(t)}function p(){b("initialised",h)}function m(){y=s.findUnprocessedMediaPlaceholders();y&&(p(),_(y,function(e){k++;var t="media-player-"+k;s.markPlaceholderAsProcessed(e),s.setPlaceholderId(e,t);var n=s.getPlayableForPlaceholder(e);n&&(n.otherSettings.placeholderWidth=s.getPlaceholderWidth(e),u(e,t,n))}))}function f(e){s.activatePlaceholder(e)}function g(){n.hide(y)}function v(){n.show(y)}function b(e,n){t.subscribe(e,n)}var y,w=r.Promise,_=e.forEach,k=(e.jsonParse,0);return{hideFlashPlayers:g,processNewPlayers:m,showFlashPlayers:v,subscribeToPlayerEvent:b,activatePlaceholder:f}}),define("module/stats/statsBindingAdapter",["module/globalPubsub","module/components/mediaPlayer/main"],function(e,t){function n(e){return{opts:{mediaType:e.kind()},name:e.name()}}t.subscribeToPlayerEvent("playing",function(t,o){e.emit("video:play",[n(o)])},!0),t.subscribeToPlayerEvent("pause",function(t,o){e.emit("video:pause",[n(o)])},!0),t.subscribeToPlayerEvent("ended",function(t,o){e.emit("video:end",[n(o)])},!0),t.subscribeToPlayerEvent("initialised",function(t,o){e.emit("video:load",[n(o)])},!0)}),define("module/stats/statsSubscriber",["module/bootstrap","istats-1","module/stats/statsBindingAdapter"],function(e,t){function n(e,n){this.config=e||{},this.istats=n||t,this.pageviews=[],this.hidden=[],this.links=[],this.processConfig(),this.bindEvents()}return n.prototype={bindEvents:function(){var t=this;e.pubsub.on("component:loaded",function(e){t.handleComponentLoaded(e)}),e.pubsub.on("component:postloaded",function(e){void 0!==e&&t.handlePostLoadedComponent(e)})},handleComponentLoaded:function(e){this.linksContainsComponentName(e)&&this.registerTrackingLink(this.getLinkByName(e))},getLinkByName:function(e){for(var t=0,n=this.links.length;t0&&(a=s.data("entityid"),(u=a.replace(/.*#/,""))!==a&&(l+="-"+u)),this.istats.track(t,{region:d[r],linkLocation:l})}},processConfig:function(){var e=this.config.pageviews||{};this.addPageviews(e);var t=this.config.hidden||{};this.addHidden(t);var n=this.config.links||{};this.addTrackingLinks(n)},appendLabels:function(e,t){return"function"==typeof e?this.applyLabels(e,t):e}},n}),define("module/stats/statsConfig",[],function(){"use strict";var e=function(e){return void 0!==e.name?e.name:"rmp"};return{links:[{name:"us-election-2016-live",selector:'[data-entityid*="us_live_page"]'},{name:"us-election-2016-az",selector:".us2016-key-states__footer"},{name:"us-election-2016-banner",selector:[".us2016-banner__title",".us-banner-link--infull",".us-banner-link--how-to-win"]},{name:"us-election-2016-ticker",selector:".us2016-ticker__headline"},{name:"topic_link_top",selector:'[data-entityid="topic_link_top"]'},{name:"topic_link",selector:'[data-entityid="topic_link"]'},{name:"topic_link_leading",selector:'[data-entityid*="leading-topics-panel"]'},{name:"topic_link_bottom",selector:'[data-entityid="topic_link_bottom"]'},{name:"recommendation_learn_more",selector:'[data-entityid*="recommendation_learn_more"]'},{name:"world-news-tv-programmes",selector:'[data-entityid*="world-news-tv-programmes"]'},{name:"world-news-tv-contact-us",selector:'[data-entityid*="world-news-tv-contact-us"]'},{name:"world-news-tv-radio",selector:'[data-entityid*="world-news-tv-radio"]'},{name:"more-from-this-index-story",selector:'[data-entityid*="more-section-index"]'},{name:"more-from-this-index-section-label",selector:'[data-entityid*="more-from-this-index-section-label"]'},{name:"pullout-inner-link",selector:'[data-entityid*="pullout-inner-link"]'},{name:"hyper-puff-headline",selector:".fetch-hyperpuff"},{name:"pictures",selector:'[data-entityid*="pictures"]'},{name:"more-corresp",selector:'[data-entityid*="csp-hyperpuff"]'},{name:"headline",selector:'[data-entityid*="correspondent-byline"]'},{name:"latest-posts",selector:'[data-entityid*="latest-posts"]'},{name:"more-story",selector:'[data-entityid*="more-on-this-story"]'},{name:"experts",selector:'[data-entityid*="correspondent-promotion-now"]'},{name:"av-stories-live",selector:'[data-entityid*="av-stories-live-compact-tablet"]'},{name:"av-stories-live",selector:'[data-entityid*="av-stories-live-wide"]'},{name:"headlines-promo",selector:'[data-entityid*="headlines-promo-wide"]'},{name:"headlines-promo",selector:'[data-entityid*="headlines-promo-compact-tablet"]'},{name:"more-uk",selector:'[data-entityid*="more-uk"]'},{name:"more-news",selector:'[data-entityid*="more-news"]'},{name:"top-stories",selector:'[data-entityid*="container-top-stories"]'},{name:"canada-stories",selector:'[data-entityid*="canada-stories"]'},{name:"us-stories",selector:'[data-entityid*="us-stories"]'},{name:"top-stories",selector:'[data-entityid*="top-stories"]'},{name:"live-event-1",selector:'[data-entityid="live_event_1"]'},{name:"live-event-2",selector:'[data-entityid="live_event_2"]'},{name:"cluster1",selector:'[data-entityid*="cluster_1"]'},{name:"cluster2",selector:'[data-entityid*="cluster_2"]'},{name:"full-story",selector:'[data-entityid*="full-story"]'},{name:"must-see",selector:'[data-entityid*="must-see"]'},{name:"av",selector:'[data-entityid*="av-stories-now"]'},{name:"features-promo",selector:'[data-entityid*="lead-feature"]'},{name:"features",selector:'[data-entityid*="feature-main"]'},{name:"explainers",selector:'[data-entityid*="explainers"]'},{name:"the-reporters",selector:'[data-entityid*="the_reporters"]'},{name:"also-in-the-news",selector:'[data-entityid*="also_in_news"]'},{name:"navigation-brand",selector:"#brand"},{name:"breaking-news-banner-pal",selector:"#breaking-news-container"},{name:"story-body",selector:".story-body__link"},{name:"the-papers",selector:'[data-entityid*="latest-content"]'},{name:"features-and-analysis",selector:'[data-entityid*="features-and-analysis"]'},{name:"strapline",selector:'[data-entityid*="strapline"]'},{name:"more-from-this-index-headline",selector:'[data-entityid*="more-from-this-index-headline"]'},{name:"most-read",selector:'[data-entityid*="most-popular-read"]'},{name:"most-watched",selector:'[data-entityid*="most-popular-watched"]'},{name:"most-read-local",selector:".page--local .most-popular .panel-read"},{name:"most-watched-local",selector:".page--local .most-popular .panel-watched"},{name:"from-other-news-sites",selector:"#comp-from-other-news-sites",type:"external"},{name:"exrelinks-primary",selector:'[data-entityid*="exrelinks-primary"]',type:"external"},{name:"exrelinks-secondary",selector:'[data-entityid*="exrelinks-secondary"]',type:"external" },{name:"topical-top-story",selector:[".hard-news-unit--topical .faux-block-link__overlay-link",".hard-news-unit--topical .hard-news-unit__headline"]},{name:"topical-related-content",selector:"#topical-stories .related-content-links"},{name:"travel-local",selector:".container--travel-weather .travel"},{name:"weather-local",selector:".container--travel-weather .weather"},{name:"local-live-internal",selector:"#comp-local-live"},{name:"local-live-external",selector:"#comp-local-live",type:"external"},{name:"local-stream-story-promo",selector:".comp-stream-story-promo__link"},{name:"narrow-navigation-primary",selector:".navigation--narrow__toplevel"},{name:"narrow-navigation-secondary",selector:".secondary-navigation--narrow"},{name:"wide-navigation-primary",selector:".navigation--wide"},{name:"wide-navigation-primary-overflow",selector:".js-navigation-panel-primary"},{name:"wide-navigation-secondary",selector:".navigation-wide-list--secondary"},{name:"wide-navigation-secondary-overflow",selector:".js-navigation-panel-secondary"},{name:"navigation-bottom",selector:".navigation--bottom"},{name:"england_nav_link",selector:'[data-entityid="england_nav_link"]'},{name:"nireland_nav_link",selector:'[data-entityid="nireland_nav_link"]'},{name:"scotland_nav_link",selector:'[data-entityid="scotland_nav_link"]'},{name:"wales_nav_link",selector:'[data-entityid="wales_nav_link"]'},{name:"connected-stream-internal",selector:["#comp-connected-stream .update .update__image","#comp-connected-stream .update .update__headline","#comp-connected-stream .update .update__body"]},{name:"connected-stream-external",selector:"#comp-connected-stream .update .update__body",type:"external"},{name:"election-2015-nation-navigation",selector:".mininav--election2015 .mininav__nation"},{name:"vocab-faq",selector:'[data-entityid*="vocab-faq"]'}],pageviews:[{on:"tabs:activate:mostread",countername:"news.popular.read.page"},{on:"tabs:activate:topstories",countername:"news.page"},{on:"tabs:activate:livetext",countername:function(e){return e.replace(/(\d+).*$/,"$1.page")}},{on:"tabs:activate:keypoints",countername:function(e){return e.replace(/(\d+).*$/,"$1.keypoints.page")}},{on:"map:asset:request:success",countername:function(e,t,n){return n.countername||e}}],hidden:[{on:"nav:header:open",action_name:"top_navigation_open"},{on:"nav:footer:open",action_name:"bottom_navigation_open"},{on:"locator:submitSearch",action_name:"news.locator"},{on:"locator:geoLocation",action_name:"news.locator"},{on:"video:load",action_type:"video",action_name:"load",labels:function(t){return{player_name:e(t)}}},{on:"video:play",action_type:"video",action_name:"play",labels:function(t){return{player_name:e(t)}}},{on:"video:pause",action_type:"video",action_name:"pause",labels:function(t){return{player_name:e(t)}}},{on:"video:end",action_type:"video",action_name:"end",labels:function(t){return{player_name:e(t)}}},{on:"tabs:activate:maprelated",action_type:"tabchange",action_name:"map-index",labels:{tab_name:"related"}},{on:"tabs:activate:maptopstories",action_type:"tabchange",action_name:"map-index",labels:{tab_name:"topstories"}},{on:"tabs:activate:mapmostwatched",action_type:"tabchange",action_name:"map-index",labels:{tab_name:"mostwatched"}},{on:"map:index:toggle",action_type:"toggle",action_name:"map-index",labels:function(e,t){return{section:e,toggle:t}}},{on:"map:asset:summary",action_type:"toggle",action_name:"map-asset-summary",labels:function(e){return{toggle:e}}},{on:"map:index:topstories",action_type:"toggle",action_name:"map-index-topstories",labels:function(e){return{toggle:e}}},{on:"medianav:select",action_type:"select",action_name:"medianav",labels:function(e,t){return{headline:e.headline,live:e.video.live,index:t}}},{on:"gallery:picture:click",action_type:"click",action_name:"gallery-enhanced"},{on:"gallery:viewer:toggle",action_type:"toggle",action_name:"gallery-enhanced-back",labels:function(e){return{position:e}}},{on:"gallery:caption:toggle",action_type:"toggle",action_name:"gallery-enhanced-caption",labels:function(e){return{toggle:e}}},{on:"gallery:imageonly:toggle",action_type:"toggle",action_name:"gallery-enhanced-image-only",labels:function(e){return{toggle:e}}},{on:"gallery:paginate:click",action_type:"click",action_name:"gallery-enhanced-paginate",labels:function(e,t){return{visibility:e,position:t}}},{on:"stories:more:success",action_type:"select",action_name:"blog-morestories",labels:function(e,t){return{request_count:t.requestCount}}},{on:"stories:fullyloaded",action_type:"event",action_name:"blog-fullyloaded"},{on:"stats:nav:narrow:primary:visibility",action_type:"toggle",action_name:"nav-narrow-primary-visibility",labels:function(e){return{visibility:e}}},{on:"stats:nav:narrow:secondary:visibility",action_type:"toggle",action_name:"nav-narrow-secondary-visibility",labels:function(e){return{visibility:e}}},{on:"stats:nav:narrow:footer:visibility",action_type:"toggle",action_name:"nav-narrow-footer-visibility",labels:function(e){return{visibility:e}}},{on:"stats:nav:narrow:top:primary:accordion:visibility",action_type:"toggle",action_name:"nav-narrow-top-primary-accordion-visibility",labels:function(e,t){return{visibility:e,link:t}}},{on:"stats:nav:narrow:bottom:primary:accordion:visibility",action_type:"toggle",action_name:"nav-narrow-bottom-primary-accordion-visibility",labels:function(e,t){return{visibility:e,link:t}}},{on:"stats:nav:wide:primary:overflow:visibility",action_type:"toggle",action_name:"nav-wide-primary-overflow-visibility",labels:function(e){return{visibility:e}}},{on:"stats:nav:wide:secondary:overflow:visibility",action_type:"toggle",action_name:"nav-wide-secondary-overflow-visibility",labels:function(e){return{visibility:e}}},{on:"stats:nav:narrow:click",action_type:"click",action_name:"nav-narrow-click",labels:function(e,t,n){return{link:e,url:t,strategy:n}}},{on:"stats:nav:wide:outsidePanel:click",action_type:"click",action_name:"nav-wide-outsidePanel-click",labels:function(e,t,n,o){return{link:e,url:t,strategy:n,withinMorePanel:o}}},{on:"stats:nav:wide:insidePanel:click",action_type:"click",action_name:"nav-wide-insidePanel-click",labels:function(e,t,n,o){return{link:e,url:t,strategy:n,withinMorePanel:o}}},{on:"banner:ticker:toggle",action_type:"toggle",action_name:"banner-ticker-click",labels:function(e){return{toggle:e}}},{on:"eucountry:toggle",action_type:"toggle",action_name:"eucountry-click",labels:function(e){return{toggle:e}}},{on:"euexplainer:toggle",action_type:"toggle",action_name:"euexplainer-click",labels:function(e){return{toggle:e}}},{on:"election:map:zoom",action_type:"zoom",action_name:"election-map-zoom",labels:function(e){return{zoom:e}}},{on:"scotref:map",action_type:"click",action_name:"scotref-map",labels:function(e){return{action:e}}},{on:"election:findaresult:change",action_type:"change",action_name:"election-findaresult-change",labels:function(e){return{url:e}}},{on:"stats:comments:open",action_type:"comments",action_name:"show_comments"},{on:"find-local:overlay:done",action_type:"done",action_name:"Locator"},{on:"stream:refresh",action_type:"click",action_name:"stream-refresh"},{on:"stream:showmore",action_type:"click",action_name:"stream-showmore"},{on:"stream:back-to-top",action_type:"click",action_name:"stream-back-to-top"},{on:"scotref:summary:filter",action_type:"click",action_name:"scotref-table-filter",labels:function(e){return{click:e}}},{on:"marketdata:chart:toggle",action_type:"toggle",action_name:"marketdata-chart-toggle",labels:function(e){return{chart_ticker:e.chart_ticker,chart_timespan:e.chart_timespan,chart_width:e.chart_width,chart_height:e.chart_height}}},{on:"election:findYourConstituency:submitSearch",action_type:"click",action_name:"election-constituency-search-submit"},{on:"election:findYourConstituency:searchError",action_type:"click",action_name:"election-constituency-search-error",labels:function(e){return{error_type:e}}},{on:"tabs:activate:summary",action_type:"click",action_name:"ni-election-tabs",labels:function(){return{click:"summary"}}},{on:"tabs:activate:stageByStage",action_type:"click",action_name:"ni-election-tabs",labels:function(){return{click:"stages"}}},{on:"tabs:activate:popular-vote2016",action_type:"click",action_name:"us2016-pop-vote-tabs",labels:function(){return{click:"2016"}}},{on:"tabs:activate:popular-vote2012",action_type:"click",action_name:"us2016-pop-vote-tabs",labels:function(){return{click:"2012"}}},{on:"tabs:activate:popular-vote2008",action_type:"click",action_name:"us2016-pop-vote-tabs",labels:function(){return{click:"2008"}}},{on:"tabs:activate:popular-vote2004",action_type:"click",action_name:"us2016-pop-vote-tabs",labels:function(){return{click:"2004"}}},{on:"tabs:activate:congress2016",action_type:"click",action_name:"us2016-congress-tabs",labels:function(){return{click:"2016"}}},{on:"tabs:activate:congress2014",action_type:"click",action_name:"us2016-congress-tabs",labels:function(){return{click:"2014"}}},{on:"tabs:activate:congress2012",action_type:"click",action_name:"us2016-congress-tabs",labels:function(){return{click:"2012"}}},{on:"tabs:activate:congress2010",action_type:"click",action_name:"us2016-congress-tabs",labels:function(){return{click:"2010"}}},{on:"ticker:pause:us2016-ticker",action_type:"click",action_name:"us-election-2016-ticker-pause"},{on:"ticker:play:us2016-ticker",action_type:"click",action_name:"us-election-2016-ticker-play"},{on:"ticker:previous:us2016-ticker",action_type:"click",action_name:"us-election-2016-ticker-previous"},{on:"ticker:next:us2016-ticker",action_type:"click",action_name:"us-election-2016-ticker-next"},{on:"ni:election:selectStage",action_type:"click",action_name:"ni-stage-select",labels:function(e){return{click:e}}},{on:"election:summary:filter",action_type:"click",action_name:"general-elections-table-filter",labels:function(e){return{click:e}}},{on:"map:fullscreen:enter",action_type:"click",action_name:"us2016-results-map-launcher",labels:{click:"interact"}},{on:"map:search:focus",action_type:"focus",action_name:"us2016-results-map-search-focus",labels:{click:"select-search"}},{on:"region:chosen:select",action_type:"click",action_name:"us2016-results-map-search-select",labels:function(e){return{click:e}}},{on:"reset-clicked",action_type:"click",action_name:"us2016-results-map-reset",labels:{click:"reset-map"}},{on:"map:open:accordion",action_type:"click",action_name:"us2016-results-map-accordion",labels:{click:"open-accordion"}},{on:"region:chosen:mapclick",action_type:"click",action_name:"us2016-results-map-state",labels:function(e){return{click:e}}},{on:"map:fullscreen:exit",action_type:"click",action_name:"us2016-results-map-close",labels:{click:"close-map"}},{on:"news:recommendation:load",action_type:"load",action_name:"news_recommendation",labels:function(e){return{content_name:e.content_name,content_count:e.content_count,rec_source:e.rec_source,rec_set:e.rec_set,breakpoint_type:e.breakpoint_type}}},{on:"news:recommendation:load_fail_api_down",action_type:"load_fail_api_down",action_name:"news_recommendation",labels:function(e){return{breakpoint_type:e.breakpoint_type}}},{on:"news:recommendation:load_fail_low_content_volume",action_type:"load_fail_low_content_volume",action_name:"news_recommendation",labels:function(e){return{breakpoint_type:e.breakpoint_type}}},{on:"betamax:video:playlist_loaded",action_type:"video",action_name:"play",labels:function(e){return{play_type:e.play_type,item_position:e.item_position,episode_id:e.vpid,section:e.section,action_location:e.action_location}}},{on:"vocab:clicked:enabled",action_type:"on",action_name:"vocab_button",labels:{vocab_on:1}},{on:"vocab:clicked:disabled",action_type:"off",action_name:"vocab_button"},{on:"vocab:cookie:vocab-enabled",labels:{vocab_on:1}},{on:"vocab:error",action_type:"vocab-error",action_name:"vocab-cymrufyw",labels:function(e){return{error_message:e}}},{on:"shareTools:visible",action_type:"view",action_name:"end-article-sharetools"},{on:"shareTools:balatarin:clicked",action_type:"share",action_name:"share_balatarin"},{on:"shareTools:extractedbalatarin:clicked",action_type:"share",action_name:"share_extractedbalatarin"},{on:"shareTools:douban:clicked",action_type:"share",action_name:"share_douban"},{on:"shareTools:extracteddouban:clicked",action_type:"share",action_name:"share_extracteddouban"},{on:"shareTools:email:clicked",action_type:"share",action_name:"share_email"},{on:"shareTools:extractedemail:clicked",action_type:"share",action_name:"share_extractedemail"},{on:"shareTools:facebook:clicked",action_type:"share",action_name:"share_facebook"},{on:"shareTools:extractedfacebook:clicked",action_type:"share",action_name:"share_extractedfacebook"},{on:"shareTools:flipboard:clicked",action_type:"share",action_name:"share_flipboard"},{on:"shareTools:extractedflipboard:clicked",action_type:"share",action_name:"share_extractedflipboard"},{on:"shareTools:friendfeed:clicked",action_type:"share",action_name:"share_friendfeed"},{on:"shareTools:extractedfriendfeed:clicked",action_type:"share",action_name:"share_extractedfriendfeed"},{on:"shareTools:googleplus:clicked",action_type:"share",action_name:"share_googleplus"},{on:"shareTools:extractedgoogleplus:clicked",action_type:"share",action_name:"share_extractedgoogleplus"},{on:"shareTools:hatena:clicked",action_type:"share",action_name:"share_hatena"},{on:"shareTools:extractedhatena:clicked",action_type:"share",action_name:"share_extractedhatena"},{on:"shareTools:kaixin:clicked",action_type:"share",action_name:"share_kaixin"},{on:"shareTools:extractedkaixin:clicked",action_type:"share",action_name:"share_extractedkaixin"},{on:"shareTools:kakaostory:clicked",action_type:"share",action_name:"share_kakaostory"},{on:"shareTools:extractedkakaostory:clicked",action_type:"share",action_name:"share_extractedkakaostory"},{on:"shareTools:line:clicked",action_type:"share",action_name:"share_line"},{on:"shareTools:extractedline:clicked",action_type:"share",action_name:"share_extractedline"},{on:"shareTools:linkedin:clicked",action_type:"share",action_name:"share_linkedin"},{on:"shareTools:extractedlinkedin:clicked",action_type:"share",action_name:"share_extractedlinkedin"},{on:"shareTools:livejournal:clicked",action_type:"share",action_name:"share_livejournal"},{on:"shareTools:extractedlivejournal:clicked",action_type:"share",action_name:"share_extractedlivejournal"},{on:"shareTools:meneame:clicked",action_type:"share",action_name:"share_meneame"},{on:"shareTools:extractedmeneame:clicked",action_type:"share",action_name:"share_extractedmeneame"},{on:"shareTools:messengerdesktop:clicked",action_type:"share",action_name:"share_messengerdesktop"},{on:"shareTools:extractedmessengerdesktop:clicked",action_type:"share",action_name:"share_extractedmessengerdesktop"},{on:"shareTools:messengermobile:clicked",action_type:"share",action_name:"share_messengermobile"},{on:"shareTools:extractedmessengermobile:clicked",action_type:"share",action_name:"share_extractedmessengermobile"},{on:"shareTools:mixi:clicked",action_type:"share",action_name:"share_mixi"},{on:"shareTools:extractedmixi:clicked",action_type:"share",action_name:"share_extractedmixi"},{on:"shareTools:moimir:clicked",action_type:"share",action_name:"share_moimir"},{on:"shareTools:extractedmoimir:clicked",action_type:"share",action_name:"share_extractedmoimir"},{on:"shareTools:odnoklassniki:clicked",action_type:"share",action_name:"share_odnoklassniki"},{on:"shareTools:extractedodnoklassniki:clicked",action_type:"share",action_name:"share_extractedodnoklassniki"},{on:"shareTools:pinterest:clicked",action_type:"share",action_name:"share_pinterest"},{on:"shareTools:extractedpinterest:clicked",action_type:"share",action_name:"share_extractedpinterest"},{on:"shareTools:plurk:clicked",action_type:"share",action_name:"share_plurk"},{on:"shareTools:extractedplurk:clicked",action_type:"share",action_name:"share_extractedplurk"},{on:"shareTools:qq:clicked",action_type:"share",action_name:"share_qq"},{on:"shareTools:extractedqq:clicked",action_type:"share",action_name:"share_extractedqq"},{on:"shareTools:renren:clicked",action_type:"share",action_name:"share_renren"},{on:"shareTools:extractedrenren:clicked",action_type:"share",action_name:"share_extractedrenren"},{on:"shareTools:telegram:clicked",action_type:"share",action_name:"share_telegram"},{on:"shareTools:extractedtelegram:clicked",action_type:"share",action_name:"share_extractedtelegram"},{on:"shareTools:twitter:clicked",action_type:"share",action_name:"share_twitter"},{on:"shareTools:extractedtwitter:clicked",action_type:"share",action_name:"share_extractedtwitter"},{on:"shareTools:viber:clicked",action_type:"share",action_name:"share_viber"},{on:"shareTools:extractedviber:clicked",action_type:"share",action_name:"share_extractedviber"},{on:"shareTools:vkontakte:clicked",action_type:"share",action_name:"share_vkontakte"},{on:"shareTools:extractedvkontakte:clicked",action_type:"share",action_name:"share_extractedvkontakte"},{on:"shareTools:wechat:clicked",action_type:"share",action_name:"share_wechat"},{on:"shareTools:extractedwechat:clicked",action_type:"share",action_name:"share_extractedwechat"},{on:"shareTools:weibo:clicked",action_type:"share",action_name:"share_weibo"},{on:"shareTools:extractedweibo:clicked",action_type:"share",action_name:"share_extractedweibo"},{on:"shareTools:whatsapp:clicked",action_type:"share",action_name:"share_whatsapp"},{on:"shareTools:extractedwhatsapp:clicked",action_type:"share",action_name:"share_extractedwhatsapp"},{on:"shareTools:zing:clicked",action_type:"share",action_name:"share_zing"},{on:"shareTools:extractedzing:clicked",action_type:"share",action_name:"share_extractedzing"},{on:"user:firstscroll",action_type:"scroll",action_name:"scroll_first"},{on:"ojComponent:click",action_type:"click",action_name:"wsoj-recs",labels:function(e){return{content_position_rec:e.clickIndex,rec_source:e.recommenderValue,rec_set:e.itemLinks,user_segment:e.userSegment}}},{on:"ojComponent:pageload",action_type:"load",action_name:"wsoj-recs",labels:function(e){return{rec_source:e.recommenderValue,rec_set:e.itemLinks,user_segment:e.userSegment}}},{on:"wsojcomponent:loadError",action_type:"load-fail",action_name:"wsoj-recs"},{on:"sportBanner:refreshButton:clicked",action_type:"click",action_name:"sport_banner_refresh"},{on:"sportBanner:closeButton:clicked",action_type:"click",action_name:"sport_banner_close"},{on:"sportBanner:loaded",action_type:"load",action_name:"sport_banner_loaded"},{on:"sportBanner:fullScorecard:clicked",action_type:"click",action_name:"sport_banner_full_score_card"},{on:"sportBanner:expandButton:clicked",action_type:"click",action_name:"sport_banner_expand"},{on:"sportBanner:collapseButton:clicked",action_type:"click",action_name:"sport_banner_collapse"},{on:"sportBanner:topicLink:clicked",action_type:"click",action_name:"sport_banner_topic_link"}]}}),define("module/navigation/overflow",["module/bootstrap","translator"],function(e,t){function n(n,a,r){function c(){return!!I.filter(function(e){return this.offsetTop>0}).length}function l(){S=o('"),T=S.find(".navigation__more-button"),E.append(S)}function u(){var t=e.config.features2&&(e.config.features2.rtl||"-rtl"===e.config.cssPostfix)?"padding-left":"padding-right";E.css(t,S.width()+"px"),E.css("max-width",B-S.width()+"px")}function d(){var e;e=new RegExp("\\b"+$+"\\b","i").test(this.className),e&&this.blur(),T.removeClass($)}function h(){var e=o(''),t=o('');t.append(e),P=e.find(".navigation-panel__inner"),n.after(t),p(),t=e=null,r.statsName&&i.emit("component:loaded",r.statsName)}function p(){for(var e,t=I,n=t.length,o=-1,i=[],s=!1;++o0;if(a.className=a.className.replace(/\binvisible\b/,""),r){s||(f(m(t,o)),s=!0);var c=a.cloneNode(!0);c=g(c),i.push(c),a.className+=" invisible"}}e=v(i),P.html(e),w()}function m(t,n){var o=t[n-1].offsetLeft;return o+=e.config.features2&&(e.config.features2.rtl||"-rtl"===e.config.cssPostfix)?-S.width():t[n-1].offsetWidth}function f(e){S.css("left",e+"px")}function g(e){var t=e.getElementsByTagName("a");return t.length&&(t[0].className="navigation-panel-toplevel__link"),e}function v(e){var t=s.documentElement.clientWidth,n=document.createDocumentFragment();_=[],k=e,C=y(t),x=Math.ceil(k.length/C),R();for(var o=0,i=C;o0&&n.appendChild(a)}return n}function b(){var e=document.createElement("ul");return e.className="navigation-panel-toplevel",e}function y(e){return e>=N[2]&&e=N[3]&&e'+t.get("navFooterSectionsButton")+"");E.before(n)}function s(){var e=L.find(".secondary-navigation__title span"),t=L.find(".selected .navigation-narrow-item span").text()||e.text();e.text(t)}function a(){N.addClass("navigation__section--enhanced"),N.removeClass("navigation__section--core"),P.addClass("navigation--narrow"),P.removeClass("navigation--bottom"),r(),$(".site-brand").after(P),M&&(c(),s(),$(".site-brand").after(L)),l()}function r(){P.children().first().removeClass("navigation--bottom__toplevel").addClass("navigation--narrow__toplevel")}function c(){if(!1!==M){var t=$("#secondary-navigation--bottom");if(L=$('
'),t){var n=t.clone();n.addClass("secondary-navigation-narrow-list"),n.removeAttr("id"),n.find(".navigation-core-title").remove(),n.find(".navigation-core-index").remove(),n.removeClass("secondary-navigation--bottom"),n.find(".navigation-arrow").on("click",function(t){t.stopPropagation(),t.preventDefault(),e.pubsub.emit("nav:narrow:secondary:arrow:clicked",t)}),t.addClass("hidden"),L.append(n)}}}function l(){return $(".navigation--narrow__toplevel, .navigation--bottom__toplevel").each(function(){var e=$(this).find(".selected .navigation-panel-secondary");if(e.length>0){0===e.find(".selected").length&&e.find("li").first().addClass("selected")}}),this}function u(){return d()||h()}function d(){return L&&L.find("ul .selected").length>0}function h(){return void 0!==L&&0===L.children().length}function p(){u()?R.emit("nav:selectedIsHidden"):R.emit("nav:selectedIsVisible")}function m(){$("body").removeClass(j),e.pubsub.emit(O,["hidden"]),H=!1}function f(){$("body").addClass(j),e.pubsub.emit(O,["visible"]),H=!0}function g(e){H?m():f()}function v(){var e,t=$(".secondary-navigation--narrow");t.hasClass("secondary-navigation--narrow-closed")?(t.removeClass("secondary-navigation--narrow-closed"),e="visible"):(t.addClass("secondary-navigation--narrow-closed"),e="hidden"),b(e)}function b(t){e.pubsub.emit("stats:nav:narrow:secondary:visibility",t)}function y(){void 0!==L&&(L.addClass("secondary-navigation--narrow-closed"),b("hidden"))}function w(t){var n=t.currentTarget;if(n&&n.href){var o,i=n.href.replace(/.+bbc\.co\.uk/i,""),s="navigation-arrow--open",a=$('.navigation-arrow[href="'+i+'"]'),r=a.find("span").eq(0).text(),c="navigation-list-item--open";$(".navigation--bottom__toplevel .navigation-arrow--open, .navigation--narrow__toplevel .navigation-arrow--open").not(a).removeClass(s),$("."+c).removeClass(c),a.hasClass(s)?(a.removeClass(s),o="hidden"):(a.addClass(s),$(n).parent().addClass(c),o="visible"),e.pubsub.emit("stats:nav:narrow:top:primary:accordion:visibility",[o,r])}}function _(){var e,t="navigation__footer--open";A.hasClass(t)?(A.removeClass(t),e="hidden"):(A.addClass(t),e="visible"),R.emit("stats:nav:narrow:footer:visibility",[e])}function k(){p()}function C(){$(".navigation-arrow--open").removeClass("navigation-arrow--open"),M&&L&&L.addClass("secondary-navigation--narrow-closed"),N.removeClass("navigation__section--open"),$("body").removeClass("narrow-primary-navigation-open")}function x(){N=$(".navigation__section"),B=$("#page"),n(),o(),i(),a(),p(),D=!0,R.emit("nav:narrow:loaded")}function S(){D?k():x()}function T(){D&&C()}var P,E,I,A,L,N,B,$=e.$,R=e.pubsub,D=(e.window,!1),M=!0,H=!1,O="stats:nav:narrow:primary:visibility",j="narrow-primary-navigation-open";return{enable:S,disable:T,togglePrimaryNav:g,toggleSecondaryNav:v,hidePrimaryNav:m,hideSecondaryNav:y,accordionNavItem:w,publishSelectedVisibilityState:p,toggleFooterNav:_}}),define("module/navigation/panels",["module/bootstrap"],function(e){function t(e){return c[e]||(c[e]=a("."+e)),c[e]}function n(e){var t=e?[a("."+e)]:c;for(var n in t)t[n].hasClass(l)||t[n].addClass(l);r.emit("nav:overflow:toggle","hidden")}function o(){a(".navigation--narrow__toplevel .navigation-arrow").each(function(e,t){var n=a(t).attr("data-panel-id");n&&(c[n]=a("."+n))})}function i(){c["navigation-panel--wide"]=a(".navigation-panel--wide")}function s(e){var o,i=e.currentTarget,s=a(i).attr("data-panel-id"),c=t(s);return c.hasClass(l)?(n(),c.removeClass(l),o=!0,r.emit("nav:overflow:toggle","visible")):(c.addClass(l),o=!1,r.emit("nav:overflow:toggle","hidden")),o}var a=e.$,r=e.pubsub,c={},l="navigation-panel--closed";return{cacheNarrow:o,cacheWide:i,close:n,togglePanel:s}}),define("module/indexTitle",["module/bootstrap"],function(e){function t(){if(void 0===n){var t=e.$(o),i=t.data("index-title-meta")||null,s=!1,a=!1;i&&i.opts&&(s=i.opts.alwaysVisible||!1,a=i.opts.onFrontPage||!1),n={element:t,alwaysVisible:s,onFrontPage:a}}return n}var n,o="#comp-index-title",i="index-title--redundant",s=function(){},a=function(){},r=function(t){var n=e.$(o+" .index-title__container"),i=0!==n.length?n:e.$(o);0!==i.length&&i.html(t)},c=function(){t().onFrontPage||t().element.removeClass(i)},l=function(){t().alwaysVisible||t().element.addClass(i)};return{getIndexTitle:t,setTitleHtml:r,setAnchorAttribute:s,appendToTitle:a,show:c,hide:l,toggle:function(){t().element.hasClass(i)?c():l()},init:function(){t().onFrontPage||c()}}}),define("module/navigation/mediator",["module/navigation/wideView","module/navigation/narrowView","module/navigation/panels","module/indexTitle","module/components/mediaPlayer/main"],function(e,t,n,o,i){function s(){i.showFlashPlayers(),e.disable(),n.close(),t.enable(),n.cacheNarrow()}function a(){t.disable(),e.enable(),n.cacheWide()}function r(){e.enable(),n.cacheWide()}function c(){t.togglePrimaryNav(),o.toggle()}function l(){t.hidePrimaryNav(),t.hideSecondaryNav()}function u(e){t.accordionNavItem(e),n.togglePanel(e)}function d(){t.toggleSecondaryNav()}function h(t){e.toggleMoreButtonHighlights(t),n.togglePanel(t)}function p(e){t.toggleFooterNav(e)}function m(){t.publishSelectedVisibilityState()}function f(){n.close(),i.showFlashPlayers()}function g(e){n.close(e)}function v(){o.hide()}function b(){o.show()}return{enableWideStrategy:a,refreshWideStrategy:r,enableNarrowStrategy:s,toggleNarrowNav:c,toggleNarrowFooterNav:p,toggleNarrowSecondaryNav:d,toggleNarrowNavItem:u,toggleWideOverflow:h,hideNarrowNav:l,publishSelectedVisibilityState:m,closePanels:f,closePanel:g,hideIndexTitle:v,showIndexTitle:b,showMediaPlaceholder:i.showFlashPlayers,hideMediaPlaceholder:i.hideFlashPlayers}}),define("module/navigation/handler",["module/bootstrap","module/featureDetector","module/navigation/mediator"],function(e,t,n){function o(){k.on("global:resize",r),k.on("global:group:changed",a),k.on("nav:strategy:changed",c),k.on("nav:strategy:unchanged",l),k.on("nav:footerButton:clicked",u),k.on("nav:arrow:clicked",d),k.on("nav:more:clicked",h),k.on("nav:sections:clicked",p),k.on("nav:narrow:secondary:arrow:clicked",m),k.on("findLocal:overlayVisible",f),k.on("nav:wide:panel:lostFocus",g),k.on("nav:overflowEmpty",v),k.on("nav:selectedIsVisible",b),k.on("nav:selectedIsHidden",y),k.on("nav:overflow:toggle",_)}function i(e){return e>2}function s(e){return!1===i(e)}function a(e){s(e)?n.enableNarrowStrategy():n.enableWideStrategy()}function r(e){i(e)&&n.refreshWideStrategy()}function c(e){ "narrow"===e?n.enableNarrowStrategy():"wide"===e&&n.enableWideStrategy()}function l(e){"wide"===e&&n.refreshWideStrategy()}function u(e){n.toggleNarrowFooterNav(e)}function d(e){n.toggleNarrowNavItem(e)}function h(e){n.toggleWideOverflow(e)}function p(e){n.toggleNarrowNav()}function m(e){n.toggleNarrowSecondaryNav()}function f(){n.hideNarrowNav()}function g(){n.closePanels()}function v(e){n.closePanel(e)}function b(){n.hideIndexTitle()}function y(){n.showIndexTitle()}function w(e){o()}function _(e){"visible"===e?n.hideMediaPlaceholder():n.showMediaPlaceholder()}var k=e.pubsub;return{init:w}}),define("module/hotspot/reflow",["module/bootstrap"],function(e){function t(){if(n(),o())for(var e=0;e=c.length}function i(e,t){e.children().detach().appendTo(t),t.removeClass(d),e.addClass(d)}function s(){r.removeClass("hotspot--hidden")}function a(e){r=e}var r,c,l,u=e.$,d="hotspot--empty";return{init:a,execute:t,unmask:s}}),define("module/windowHelper",["module/bootstrap","vendor/lo-dash/lo-dash"],function(e,t){function n(n){e.$(e.window).on("resize",t.debounce(n,100))}function o(){return e.window.innerWidth}return{getInnerWidth:o,onResize:n}}),define("module/strategiser",["module/bootstrap","module/windowHelper"],function(e,t){function n(){for(var e,n=1;n<=4;n++)t.getInnerWidth()>=d[n]&&(e=n);return e}function o(){s(),i()?(u.trigger("strategyChange",c),e.pubsub.emit("global:group:changed",c)):e.pubsub.emit("global:resize",c)}function i(){return c!==l}function s(){l=c,c=n()}function a(e){u.on("strategyChange",e)}function r(){o(),t.onResize(o)}var c,l,u=e.$({}),d={1:0,2:400,3:600,4:1008};return{init:r,determineStrategy:n,subscribeToStrategyChange:a}}),define("module/hotspot/handler",["module/bootstrap","module/hotspot/reflow","module/strategiser"],function(e,t,n){function o(){n.subscribeToStrategyChange(function(e,t){i(t)})}function i(e){a!==e&&(null===a&&4===e?t.execute():void 0!==r[e][a]&&t.execute(),null==a&&t.unmask(),a=e)}function s(){var s=e.$(".hotspot");s.length<2||(t.init(s),i(n.determineStrategy()),o())}var a=null,r={1:{4:1},2:{4:1},3:{4:1},4:{1:1,2:1,3:1}};return{init:s}}),define("module/dotcom/facade",["module/bootstrap"],function(e){return{onResize:function(){e.window&&e.window.bbcdotcom&&void 0!==e.window.bbcdotcom.reset&&e.window.bbcdotcom.reset()}}}),define("module/dotcom/handler",["module/bootstrap","module/dotcom/facade"],function(e,t){function n(){s.on("global:resize",o),s.on("global:group:changed",o)}function o(e){t.onResize()}function i(e){n()}var s=e.pubsub;return{init:i}}),define("module/tableScroll",["module/bootstrap"],function(e){function t(){for(var e=document.getElementsByClassName("responsive-table-container"),t=e.length,i=0;ir+5}function a(){return!!navigator.userAgent.match(/Android 2/i)}var r=0;return{init:function(){a()&&t()}}}),define("module/components/handler",["module/bootstrap"],function(e){return{handleSuccess:function(t,n){var o=e.$(t.selector);if(o){var i=document.createElement("div");i.innerHTML=n,o.replaceWith(i.childNodes)}},enable:function(t){var n=e.$(t.selector);n&&n.removeClass("hidden")},disable:function(t){var n=e.$(t.selector);n&&n.addClass("hidden")}}}),define("module/components/loader",["module/bootstrap","module/components/handler","deviceInspector","config"],function(e,t,n,o){var i={components:{},batchStore:[],device:"",register:function(e){this.components[e.id]=e},registerComponentsFromDom:function(){for(var t=e.$("[data-comp-meta]"),n=t.length-1;n>=0;n--){var o=e.$(t[n]).data("comp-meta");o&&(o.selector="#"+t[n].id,this.register(o))}},init:function(t){t=t||{},this.registerComponentsFromDom(),n=t.deviceInspector||n,this.device=n.getGroup(),this.processComponents(),e.pubsub.on("deviceGroup",function(e){i.device=e,i.processComponents()})},processComponents:function(){for(var t in this.components){var n=this.components[t],o=this.shouldShow(n.deviceGroups);!n.loaded&&o?i.load(n):n.loaded&&!o?this.callHandler(n,"disable"):n.loaded&&o&&this.callHandler(n,"enable")}this.requestComponents(this.batchStore),e.pubsub.emit("loader:process:done")},load:function(e){switch(e.opts.loading_strategy){case"post_load":this.requestComponents([e]);break;case"batch_load":this.batchStore.push(e);break;default:this.callHandler(e,"handleSuccess")}e.loaded=!0},shouldShow:function(e){return!e||-1!==e.indexOf(i.device)},requestComponents:function(t){var n=t.length,i={batch:{}};if(n){for(;n--;){var s=t[n],a=s.type||s.name;s.opts.loading_strategy="include_content",i.batch[a]={opts:s.opts,id:s.id},s.template&&(i.batch[a].template=s.template)}var r=e.$.param(i),c=o.pathPrefix+(o.languageVariant?"/"+o.languageVariant:"")+"/components?"+r;e.$.ajax({url:c,dataType:"json",success:e.$.proxy(this.processResponse,this)})}},processResponse:function(e){var t;for(var n in e){t=i.components[n];var o=e[n];i.callHandler(t,"handleSuccess",o)}i.batchStore=[]},callHandler:function(e,n,o){var s=e.handler;"default"===s?(t[n].call(t,e,o),i.emitEvent(e,n)):require(["module/components/"+s],function(s){s[n]?s[n].call(s,e,o):t[n].call(t,e,o),i.emitEvent(e,n)})},emitEvent:function(t,n){var o="handleSuccess"===n?"loaded":n;e.pubsub.emit("component:"+o,[t.name,t])}};return i}),define("module/localisation/scriptToggle",["module/bootstrap","deviceInspector"],function(e,t){var n=e.$,o={zhongwen:["simp","trad"],ukchina:["simp","trad"],serbian:["lat","cyr"]},i={zhongwen:"ckps_chinese",ukchina:"ckps_chinese",serbian:"ckps_serbian"};return{init:function(){if(!e.config.isWorldService)return!1;var t=e.config.service,n=o.hasOwnProperty(t),i=document.querySelector(".script-toggle");if(!n||!i)return!1;this.bindEvents(t)},bindEvents:function(e){var t=this;n(".script-toggle").on("click",function(o){var i=t.getVariant(e,n(this));t.setCookie(e,i)})},getVariant:function(e,t){var i=t.attr("data-variant"),s=o[e];return i&&-1!==n.inArray(i,s)?i:null},setCookie:function(t,n){if(!i.hasOwnProperty(t)||!n)return!1;var o=window.location.hostname.match(/com/)?".bbc.com":".bbc.co.uk";document.cookie=i[t]+"="+n+"; expires="+new Date((new Date).getTime()+31536e6).toGMTString()+"; path=/; domain="+o,e.pubsub.emit("scriptToggle:cookieSaved",[{name:i[t],value:n}])}}}),define("module/commentCounts",["module/bootstrap","config"],function(e,t){var n=e.$,o=e.$({}),i=!1;return{init:function(e){var s,a=[];if(s=e?e+" .js-comment-count":".js-comment-count",n(s).each(function(){a.push(n(this).attr("data-comments-id"))}),a.length>0){var r=t.commentsHost;window.location.hostname.match(/bbc.com/)&&(r=r.replace("bbc.co.uk","bbc.com")),n.getScript(r+"/modules/comments/getcount/?items="+a.toString(),function(){i||(i=!0,o.trigger("commentsButtonCodeCanRun"))})}else i||(i=!0,o.trigger("commentsButtonCodeCanRun"))},onCommentsButtonCodeCanRun:function(e){o.on("commentsButtonCodeCanRun",e)}}}),define("module/initialiser",["module/bootstrap","module/navigation/handler","module/hotspot/handler","module/dotcom/handler","module/indexTitle","module/tableScroll","module/components/loader","module/strategiser","module/localisation/scriptToggle","module/commentCounts"],function(e,t,n,o,i,s,a,r,c,l){function u(){a.init(),s.init(),l.init(),i.init(),t.init(),n.init(),o.init(),c.init(),r.init()}return{init:u}}),define("module/urlShrinker",["module/bootstrap"],function(e){var t=e.$;return{find:function(e){return this.links=t(e),this},bindEvents:function(){this.links.on("click",this.shorten),e.pubsub.emit("urlShrinker:eventsBinded")},shorten:function(){var e=this.getAttribute("data-target-url"),n=this.getAttribute("data-social-url");t.ajax({async:!1,url:"http://www.bbc.co.uk/modules/sharetools/v1/shrink.json?url="+encodeURIComponent(e),success:t.proxy(function(e,t,o){this.href=n+e.url},this)})}}}),function(){function e(e,t,n){"use strict";var o=window.document.createElement("link"),i=t||window.document.getElementsByTagName("script")[0],s=window.document.styleSheets;return o.rel="stylesheet",o.href=e,o.media="only x",i.parentNode.insertBefore(o,i),o.onloadcssdefined=function(e){for(var t,n=0;n20)?t:i>1&&i<5&&(e>20||e<10)?n:o},n.prototype.gaelicRelativeTime=function(e,t,n,o){return 1===e?t:2===e?n:o},n.prototype.minutesAgo=function(e){switch(t.getLocale()){case"ru":case"ru-UK":return this.russianRelativeTime(e,t.get("singularMinutesAgo"),t.get("genSingularMinutesAgo"),t.get("genPluralMinutesAgo")).replace("{x}",e);case"gd":return this.gaelicRelativeTime(e,t.get("singularMinutesAgo"),t.get("dualMinutesAgo"),t.get("pluralMinutesAgo")).replace("{x}",e);default:return 1===e?t.get("oneMinuteAgo"):t.get("xMinutesAgo").replace("{x}",e)}},n.prototype.hoursAgo=function(e){switch(t.getLocale()){case"ru":case"ru-UK":return this.russianRelativeTime(e,t.get("singularHoursAgo"),t.get("genSingularHoursAgo"),t.get("genPluralHoursAgo")).replace("{x}",e);case"gd":return this.gaelicRelativeTime(e,t.get("singularHoursAgo"),t.get("dualHoursAgo"),t.get("pluralHoursAgo")).replace("{x}",e);default:return 1===e?t.get("oneHourAgo"):t.get("xHoursAgo").replace("{x}",e)}},n.prototype.timeAgoInWords=function(n){var o=Math.floor(n/60),i=Math.floor(n/3600);return o<1?t.get("lessThanAMinuteAgo"):i<1?this.minutesAgo(o):i<10?this.hoursAgo(i):(e.pubsub.emit("timestamp:relative:done",!0),null)},n}),define("module/components/timestampAdaptor",["module/timestamp"],function(e){var t=function(t){new e(new Date((new Date).toUTCString()).getTime(),t)};return t(),{reProcess:t}}),define("module/polyfill/location.origin",[],function(){window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""))}),define("module/base",["module/bootstrap","module/stats/statsSubscriber","module/stats/statsConfig","module/initialiser","module/urlShrinker","deviceInspector","module/iconLoader","module/stats/comscore","module/noTouchDetectionForCss","module/components/commentCountAdapter","module/components/fauxBlockLink","module/components/responsiveImage","module/components/timestampAdaptor","module/polyfill/location.origin"],function(e,t,n,o,i,s,a,r){function c(){e.config.service||(e.config={service:"news"})}var l=function(){function t(t){var n=/device--(?:feature|smart|tablet|wide)/,o=document.body.className.split(" "),i=o.length,s=-1;for(/^group\d$/.test(t)&&(n=/device--group/);++s'+t+''),this.bindEvents(),this.listen(),this.element};return t.prototype={bindEvents:function(){this.element.on("click",function(t){t.preventDefault(),e.pubsub.emit("stories:more:request")})},listen:function(){e.pubsub.on("stories:more:loading",e.$.proxy(this.handleLoading,this)),e.pubsub.on("stories:more:success",e.$.proxy(this.handleSuccess,this)),e.pubsub.on("stories:more:error",e.$.proxy(this.handleError,this)),e.pubsub.on("stories:fullyloaded",e.$.proxy(this.handleFullyLoaded,this))},handleLoading:function(e){this.element.attr("disabled","disabled")},handleSuccess:function(e){this.element.removeAttr("disabled")},handleError:function(e){this.element.remove()},handleFullyLoaded:function(e){this.element.remove()}},{create:function(e){return new t(e)}}}),define("module/components/shareTools",["module/bootstrap"],function(e){var t=e.$;return{handleSuccess:function(e){var n=t(e.selector),o=n.find(".share__button"),i=n.find(".share");o.on("click",t.proxy(this.toggleShareToolsVisibility,this,i,o))},toggleShareToolsVisibility:function(e,t,n){e.toggleClass("show"),t.toggleClass("active"),n.preventDefault()}}}),define("module/components/blog",["module/bootstrap","module/blog/blogButton","module/imageenhancer","module/components/mediaPlayer/main","module/timestamp","module/components/shareTools","module/components/mediaPlayer/main","translator"],function(e,t,n,o,i,s,a,r){var c=e.$,l={init:function(n){!function(){var t=["Webkit","Moz"],n=[];for(var o in t)n.push(document.body.style[t[o]+"AnimationName"]);e.$("html").addClass(c.inArray("",n)>-1?"css-anim":"animated-gif")}(),this.enhanceContent(),this.container=c(n.selector),this.nextStoriesLink=this.hasNextStories(this.container),this.requesting=!1,this.requestCount=0,this.nextStoriesLink&&(this.bindEvents(),this.container.after(t.create(r.get("moreStories")))),this.bindShareButtons(this.container)},enhanceContent:function(){new n(".story-body figure img,.story-body .HTML5figure img"),new i(new Date((new Date).toUTCString()).getTime()),o.processNewPlayers()},bindEvents:function(){e.pubsub.on("stories:more:success",c.proxy(function(e){this.handleSuccess(e)},this)),e.pubsub.on("stories:more:error",c.proxy(function(){this.handleError()},this)),e.pubsub.on("stories:more:request",c.proxy(function(){this.handleRequest()},this)),e.pubsub.on("stories:more:loading",c.proxy(function(){this.handleLoading()},this))},hasNextStories:function(e){return e.attr("data-next")},setRequesting:function(e){this.requesting=e},setNextStoriesLink:function(t){this.nextStoriesLink=this.hasNextStories(t),this.nextStoriesLink||e.pubsub.emit("stories:fullyloaded")},handleRequest:function(){this.requesting||this.getMoreStories(this.nextStoriesLink)},handleLoading:function(){this.setRequesting(!0)},handleSuccess:function(e){e=c(e),this.setRequesting(!1),this.setNextStoriesLink(e),this.insertStoriesIntoDom(e.children()),this.enhanceContent()},handleError:function(){this.setRequesting(!1)},insertStoriesIntoDom:function(e){this.container.append(e),this.bindShareButtons(e),a.processNewPlayers()},getRequestCount:function(){return this.requestCount},getMoreStories:function(t){t&&(this.requestCount++,e.pubsub.emit("stories:more:loading"),c.ajax({url:t,success:c.proxy(function(t){e.pubsub.emit("stories:more:success",[t,{requestCount:this.getRequestCount()}])},this),error:c.proxy(function(){e.pubsub.emit("stories:more:error")},this)}))},bindShareButtons:function(e){e.find(".js-share-tools").each(function(e,t){s.handleSuccess({selector:"#"+t.id})})}};return{handleSuccess:function(e,t){l.init.apply(l,arguments)},init:function(e){var t={selector:e.selector};l.init.apply(l,[t])}}}),define("module/blog/blogAdapter",["module/bootstrap","module/components/blog"],function(e,t){var n=e.$,o=n("#comp-blog");if(o.length){var i=o.data("comp-meta");if(i){var s={id:i.id||"",type:i.type||"",handler:i.handler||"",deviceGroups:i.deviceGroups||null,loaded:!0,selector:"#comp-blog",template:i.template};t.init(s)}}}),define("module/components/adverts",["module/bootstrap","vendor/lo-dash/lo-dash"],function(e,t){var n=t.debounce(function(){bbcdotcom.adverts.layout.reset()},150);return{handleSuccess:function(t){"undefined"!=typeof bbcdotcom&&void 0!==bbcdotcom.objects&&bbcdotcom.objects("bbcdotcom.adverts.slot")&&e.$(window).on("resize",n)}}}),define("module/components/advertsAdapter",["module/components/adverts"],function(e){e.handleSuccess()}),define("module/poller",["module/bootstrap"],function(e){function t(t,n){return e.$.extend(t,n)}function n(e){var t="cachebuster="+Math.floor((new Date).getTime()/1e3);return e.indexOf("?")>0?e+"&"+t:e+"?"+t}function o(e){return e&&e>=3e4}function i(e){var t=!1;return"clientdirective"in e&&"pollPeriod"in e.clientdirective&&(t=e.clientdirective.pollPeriod),"pollPeriod"in e&&(t=e.pollPeriod),!(!s(t)&&(t=parseInt(t,10),isNaN(t)))&&(0===this.updateFrequency&&(t=!1),t)}function s(e){return"number"==typeof e}var a=function(e,n,o){this.setPollingTime(e),this.options={timeout:1e4},this.setUrl(n),this.polling=!1,this.options=t(this.options,o),this.cacheBusting=!1};return a.prototype={setUrl:function(e){this.url=e},buildUrl:function(){return this.cacheBusting?n(this.url):this.url},setPollingTime:function(e){s(e)&&e>=30&&e<=7200&&(this.updateFrequency=1e3*e)},startPolling:function(e){this.polling=!0,this.options=t(this.options,e),this.poll()},stopPolling:function(){this.polling=!1},poll:function(){if(this.polling&&this.url){var t=this.options.callbackName||"callback",n=this;e.$.ajax({url:n.buildUrl(),dataType:"jsonp",timeout:this.options.timeout,jsonpCallback:t,method:"get",success:function(e){var t=i(e);if(o(t)?(n.updateFrequency=t,n.rePoll()):n.stopPolling(),n.options.success){var s=n.options.success(e);n.url=s||n.url}},error:function(e){n.options.error&&n.options.error(e)}})}},rePoll:function(){if(this.updateFrequency){var e=this;window.setTimeout(function(){e.poll()},e.updateFrequency)}},stopCacheBusting:function(){this.cacheBusting=!1},startCacheBusting:function(){this.cacheBusting=!0}},a}),define("module/components/breakingNews/storage",[],function(){function e(e){return s[e]}function t(e,t){s[e]=t}function n(t){return localStorage.getItem(t)||e(t)}function o(e,n){t(e,n);try{localStorage.setItem(e,n)}catch(e){}}var i={},s={};return i.articleAlreadySeen=function(e){return n("news/breaking-news-last-seen")===e.toString()},i.setArticleAsSeen=function(e){o("news/breaking-news-last-seen",e.toString())},i}),define("module/components/breakingNews/view",["module/bootstrap"],function(e){function t(){a.off("click","button"),a.empty()}function n(){return e.$("#breaking-news-container")}function o(){a.hide(),i(),t()}function i(){"BODY"!==s.tagName&&s.focus()}var s,a,r={},c=(e.window.document,e.$({}));return r.getAssetIdFromHtml=function(t){var n=e.$;try{n=e.$(t)}catch(e){return""}return n.find("a").data("asset-id")},r.insert=function(e){a=n(),a.show(),a.html(e),s=document.activeElement,a.on("click","button",function(){o(),c.trigger("close")})},r.getPollingUrl=function(){return n().data("polling-url")},r.onClose=function(e){c.on("close",e)},r}),define("module/components/breakingNews/main",["module/bootstrap","module/poller","module/components/breakingNews/storage","module/components/breakingNews/view"],function(e,t,n,o){function i(){r.startPolling({callbackName:"breakingNews",success:function(e){if(e&&e.html){var t=o.getAssetIdFromHtml(e.html);!t||n.articleAlreadySeen(t)||s(t)||(n.setArticleAsSeen(t),o.insert(e.html),a())}}})}function s(e){return window.config&&window.config.asset&&window.config.asset.asset_id===e.toString()}function a(){r.stopPolling()}var r,c={};return c.init=function(){var e=o.getPollingUrl();e&&(r=new t(6e4,5e3),r.setUrl(e),i(),o.onClose(function(){i()}))},c}),define("module/components/breakingNewsAdapter",["module/components/breakingNews/main"],function(e){e.init()}),function(e){"function"==typeof define&&define.amd?define("vendor/xdomainrequest/xdomainrequest",["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){if(e.support.cors||!e.ajaxTransport||!window.XDomainRequest)return e;var t=/^(https?:)?\/\//i,n=/^get|post$/i,o=new RegExp("^(//|"+location.protocol+")","i");return e.ajaxTransport("* text html xml json",function(i,s,a){if(i.crossDomain&&i.async&&n.test(i.type)&&t.test(i.url)&&o.test(i.url)){var r=null;return{send:function(t,n){var o="",a=(s.dataType||"").toLowerCase();r=new XDomainRequest,/^\d+$/.test(s.timeout)&&(r.timeout=s.timeout),r.ontimeout=function(){n(500,"timeout")},r.onload=function(){var t="Content-Length: "+r.responseText.length+"\r\nContent-Type: "+r.contentType,o={code:200,message:"success"},i={text:r.responseText};try{if("html"===a||/text\/html/i.test(r.contentType))i.html=r.responseText;else if("json"===a||"text"!==a&&/\/json/i.test(r.contentType))try{i.json=e.parseJSON(r.responseText)}catch(e){o.code=500,o.message="parseerror"}else if("xml"===a||"text"!==a&&/\/xml/i.test(r.contentType)){var s=new ActiveXObject("Microsoft.XMLDOM");s.async=!1;try{s.loadXML(r.responseText)}catch(e){s=void 0}if(!s||!s.documentElement||s.getElementsByTagName("parsererror").length)throw o.code=500,o.message="parseerror","Invalid XML: "+r.responseText;i.xml=s}}catch(e){throw e}finally{n(o.code,o.message,i,t)}},r.onprogress=function(){},r.onerror=function(){n(500,"error",{text:r.responseText})},s.data&&(o="string"===e.type(s.data)?s.data:e.param(s.data)),r.open(i.type,i.url),r.send(o)},abort:function(){r&&r.abort()}}}}),e}),define("module/components/capercaillie/constituencySearch",["module/bootstrap","translator","vendor/xdomainrequest/xdomainrequest"],function(e,t){function n(n){function o(e,t){c("constituencySearchInternalError",t)}function i(n,o){var i;if(n&&n.response&&n.response.details&&n.response.details[0]&&n.response.details[0].externalId&&void 0!==n.response.details[0].distance){if(i=n.response.details[0].externalId,n.response.details[0].distance,"cymrufyw"===e.config.service&&"W"!==i[0].toUpperCase())return void c("constituencySearchNoResults",o);if(n.response.details[0].distance>=0)return e.pubsub.emit("election:findYourConstituency:submitSearch"),void r(t.get("constituencySearchConstituencyPath")+i)}c("constituencySearchNoResults",o)}function s(){var e;if(d(b).text("").addClass("hidden"),e=d(y).val(),!a(e))return void c("constituencySearchNoResults",e);d(f).addClass("constituency-search--searching"),d.ajax({url:p.replace("SEARCH_POSTCODE",l(e)),dataType:"json",success:d.proxy(function(t){i(t,e)},this),error:d.proxy(function(t){o(t,e)},this)})}function a(e){return!!e.match(new RegExp(m))}function r(e){window.location=e}function c(n,o){e.pubsub.emit("election:findYourConstituency:searchError",n),o=void 0===o?"":encodeURIComponent(o).replace(/%20/g," "),d(f).removeClass("constituency-search--searching"),d(b).html(t.get(n).replace("{postcode}",o)).removeClass("hidden")}function l(e){return encodeURIComponent(e.toUpperCase().replace(/ /g,""))}function u(e){var t;"keypress"===e.type&&13!==e.keyCode||(t=d(y).val())!==d(y).attr("placeholder")&&d(y).val(t.toUpperCase())}var d=e.$,h=e.config.environment?e.config.environment.replace("sandbox","live"):"live",p="https://open."+h+".bbc.co.uk/locator/locations/SEARCH_POSTCODE/details/gss-seat?op=intersect&format=json",m="GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKPS-UW]) *[0-9][ABD-HJLNP-UW-Z]{2}",f="#"+n,g="#"+n+"-template",v="#"+n+"-form",b="#"+n+"-message",y="#"+n+"-input",w="#"+n+"-search";(function(){return e.config.locatorFlagPole})()&&(d(g).after(d(g).html()),"placeholder"in document.createElement("input")==!1&&function(){var e=d(e);e.find("[placeholder]").each(function(){d(this).val(d(this).attr("placeholder")),d(this).on("focus",function(){d(this).val("")}),d(this).on("focusout",function(){""===d(this).val()&&d(this).val(d(this).attr("placeholder"))})}),e.on("submit",function(){e.find("[placeholder]").each(function(){d(this).val()===d(this).attr("placeholder")&&d(this).val("")})})}(),function(){d(v).on("submit",function(e){e.preventDefault()}),d(y).on("focusout keypress",d.proxy(u,this)),d(w).on("click",d.proxy(s,this))}())}return{init:function(e){return new n(e)}}}),define("module/components/capercaillie/constituencySearchAdapter",["module/bootstrap","module/components/capercaillie/constituencySearch"],function(e,t){e.$(".capercaillie").each(function(){var e=$(this).attr("id");e&&t.init(e)})}),define("module/components/commentsModule",["module/bootstrap"],function(e){var t=e.$,n=e.pubsub;return{commentsLoaded:function(){this.spinner.remove()},disableAction:function(e){e.preventDefault()},loadComments:function(){var e=this.component.opts.commentsUrl,o=this.component.opts.errormessage,i=this.commentsAction;window.location.hostname.match(/bbc.com/)&&(e=e.replace("bbc.co.uk","bbc.com")),t.ajax({url:e,type:"GET",dataType:"html",timeout:3e4,xhrFields:{withCredentials:!0},success:function(e){i.replaceWith('
'+e+"
")},error:function(e){i.replaceWith("

"+o+"

")},complete:function(){n.emit("stats:comments:open")}})},openComments:function(){this.spinner=t('
'),this.spinner.appendTo(this.component.selector),this.loadComments()},handleSuccess:function(e){e.opts.jsEnabled&&(this.component=e,this.commentsAction=t(e.selector),n.on("stats:comments:open",t.proxy(this.commentsLoaded,this)),this.openComments())}}}),define("module/components/commentsButton",["module/bootstrap","module/commentCounts","module/components/commentsModule"],function(e,t,n){var o=e.$;return{disableAction:function(e){e.preventDefault()},triggerComments:function(){this.commentsAction.off("click",o.proxy(this.triggerComments,this)),n.handleSuccess(this.component)},handleSuccess:function(e){var n="dna-comment-count_"+e.opts.commentsId,i=o("#"+n+".dna-comment-count-show").not(".comments-button__count");if(i.length&&parseInt(i.text(),10)>0){var s=o(e.selector+" .js-comment-count");s.text(i.text()),s.addClass("dna-comment-count-show")}else t.init();e.opts.jsEnabled&&(this.component=e,this.component.selector+=" a",this.commentsAction=o(e.selector),this.commentsAction.on("click",o.proxy(this.disableAction)),this.commentsAction.on("click",o.proxy(this.triggerComments,this)),-1!==window.location.href.indexOf("#comp-comments-button")&&this.triggerComments())}}}),define("module/components/commentsButtonAdapter",["module/components/commentsButton","module/components/commentCountAdapter"],function(e,t){var n=document.getElementById("comp-comments-button");if(n){var o=JSON.parse(n.getAttribute("data-comp-meta"));o&&(o.selector="#"+o.id),t.onCommentsButtonCodeCanRun(function(){e.handleSuccess(o)})}}),define("module/components/correspondentBlogAdapter",["module/components/blog"],function(e){var t=$("#comp-correspondent");if(t.length){var n=t.data("comp-meta");n&&(n.selector="#comp-correspondent",e.init(n))}}),define("module/components/fauxBlockLinkAdapter",["module/components/fauxBlockLink"],function(e){return{init:function(){}}}),define("module/components/hardNewsUnit",["module/bootstrap"],function(e){return{init:function(t){var n=e.$(t+" .faux-block-link");n.on("mouseover",".faux-block-link__overlay-link",function(e){e.delegateTarget.className+=" faux-block-link--hover"}),n.on("mouseout",".faux-block-link__overlay-link",function(e){ e.delegateTarget.className=e.delegateTarget.className.replace(/ faux-block-link--hover/,"")})}}}),define("module/hyperpuff/minihyper",["module/bootstrap","config"],function(e,t){var n=['"].join(""),o=function(e,t){return n.replace("{{title}}",e).replace("{{content}}",t)};return{init:function(){var n;try{n=t.asset.options.allowRelatedStoriesBox}catch(e){n=!1}if(n){var i=e.$(".hyperpuff"),s=e.$(".hyper-title",i).text(),a=e.$(".group .unit",i),r=e.$(".story-body__introduction").first(),c=document.createElement("div"),l=a.length<4?a.length:4;if(i.length){for(var u=0;u=0&&n.top0&&n.bottom<=t;return o||i}};return i}),define("module/components/listShowAll",["module/bootstrap"],function(e){var t=e.$;return function(e,n){function o(e){e.on("click",t.proxy(i,this))}function i(){s.remove(),e.removeClass(r.closedClass),r.focusAfter.get(0).focus(),r.onClick&&a.trigger("click")}e=t(e);var s,a=t({}),r={showButton:!0,buttonText:"Show all",closedClass:"list-show-all__closed",buttonClass:"list-show-all__button",onClick:!1,focusAfter:e};t.extend(r,n),r.showButton&&(s=function(e,n){var i=t("
")}i(),o("success",e,t)},error:function(e){i(),o("error","Error: 404",t)}})})}()},t}),define("module/history/native",["module/bootstrap"],function(e){return function(t,n){this.EmittedFromHistory=!1;for(var o=this,i=0,s=t.length;i',items:'
    ',item:'
  1. {{label}} {{headline}}
  2. '};return{init:function(e,t){return this.container=o(e),this.mediaItems=t,this.mediaNav=this.createNav(),this.mediaNavContainer=this.mediaNav.find(".media-nav__items"),this.mediaNavItems=this.mediaNavContainer.find(".media-nav__item"),this.supportsCarousel()&&(this.mediaNav.addClass(a.carousel),this.setMediaNavWidth()),this.container.after(this.mediaNav),this.bindEvents(),this},createNav:function(){var e=o(r.items);return o.each(this.mediaItems,o.proxy(function(t,n){e.append(this.createNavItem(t,n))},this)),o(r.container).append(e)},createNavItem:function(e,t){var n=t.video.live,s=n?i.live:i.watch,c=n?a.live:a.ondemand,l=r.item.replace("{{itemClass}}",c).replace("{{label}}",s).replace("{{headline}}",t.headline);return o(l)},supportsCarousel:function(){return!t.is("AndroidMobile2")},setMediaNavWidth:function(){var e=this.mediaItems.length*s.item,t=(this.mediaItems.length-1)*s.itemSpacing,n=e+t;this.mediaNavContainer.css("width",n)},bindEvents:function(){this.mediaNavContainer.on("click","li",o.proxy(function(t){var n=o(t.currentTarget),i=this.mediaNavItems.index(n);n.hasClass(a.highlight)||(e.pubsub.emit("medianav:select",[this.mediaItems[i],i]),this.highlightItem(i))},this))},highlightItem:function(e){this.mediaNavItems.removeClass(a.highlight).eq(e).addClass(a.highlight)}}}),define("module/liveEvent/liveMediaPlayer",["module/bootstrap","module/components/mediaPlayer/main","module/featureDetector","module/liveEvent/liveMediaPlayerView"],function(e,t,n,o){function i(e){return c.grep(e,function(e){if(e.video)return!0})}function s(e){a.html(r[e]),t.processNewPlayers()}var a,r,c=e.$,l={ITEMS_NOT_ARRAY:"init expects an array as it's first parameter"};return{init:function(t,n){if(t&&n&&document.querySelector(t)){if(!c.isArray(n))throw TypeError(l.ITEMS_NOT_ARRAY);a=e.$("#lep-playable-data"),r=a.data("lep-playable-html"),r&&(this.selector=t,this.mediaItems=i(n),this.createView(),this.bindEvents(),this.loadMediaItem(0))}},createView:function(){this.view=o.init(this.selector,this.mediaItems)},bindEvents:function(){e.pubsub.on("medianav:select",c.proxy(function(e,t){s(t)},this))},loadMediaItem:function(e){s(e),this.view.highlightItem(e)}}}),define("module/live-event",["config","module/bootstrap","module/liveEvent/timeline","module/liveEvent/timelineView","module/poller","module/tabbed/tabbed","module/transclude","module/ajaxForm/ajaxForm","module/ajaxForm/ajaxFormView","module/history/history","module/liveEvent/liveMediaPlayer"],function(e,t,n,o,i,s,a,r,c,l,u){return{init:function(e,r){!function(){var e=["Webkit","Moz"],n=[];for(var o in e)n.push(document.body.style[e[o]+"AnimationName"]);t.$("html").addClass(n.indexOf("")>-1?"css-anim":"animated-gif")}(),u.init("#media-wrapper",r);var c=t.$,d=c("#live-tabs li"),h=c("#live-panels .panel"),p=c(".tab-2 a")[0],m=(p&&h.splice(0,2,h[1],h[0]),d[0]&&new s(d,h),new a,new n(e.channelId,new o("#live-timeline"),new i(e.pollPeriod),{sort:e.channelOrder,active:e.isLive,pulsarPollingHost:e.pollingHost}));new l(["tabs:activate"],{eventName:"tabs:activate",data:[0]});m.init()}}}),define("module/components/liveEventPage",["module/live-event"],function(e){var t=document.getElementById("live-event-page"),n=t.getAttribute("data-live-event-opts"),o=JSON.parse(n),i=t.getAttribute("data-media-player-items"),s=JSON.parse(i);e.init({channelId:o.channelId,channelOrder:o.channelOrder,pollingHost:o.pollingHost,pollPeriod:o.pollPeriod,isLive:o.isLive},s)}),define("module/components/liveEventPromo",["config","module/bootstrap","module/poller","module/timestamp"],function(e,t,n,o){return{pollingUrl:function(e,t,n){return void 0===t&&(t={service:"nfp"}),e+"/"+t.service+"/walkietalkie/latest_index_asset/"+n},handleSuccess:function(){if(e.features.liveeventcomponent){this.init(e.pollingHost,null);var n=t.$("primary-live-event.faux-block-link");n.on("mouseover",".faux-block-link__overlay-link",function(e){e.delegateTarget.className+=" faux-block-link--hover"}),n.on("mouseout",".faux-block-link__overlay-link",function(e){e.delegateTarget.className=e.delegateTarget.className.replace(/ faux-block-link--hover/,"")})}},init:function(i,s){var a=t.$,r=this;a("[data-channel]").each(function(){var t=a(".live-event-index__container",this),c=a(".live-event-index__summary",t),l=a(".live-event-index__entries",t),u=a(this).attr("data-channel"),d=new n(30),h="",p=r.pollingUrl(i,e,u);d.startCacheBusting(),d.setUrl(p),d.startPolling({success:function(e){if(a.trim(l.html())||c.remove(),e.entryId!==h){var t=null;if(e.createTime){var n=e.createTime.split(/[\-T:]/g),i=new Date(n[0],n[1]-1,n[2]);i.setHours(n[3],n[4],n[5]);var r=((new Date).getTime()-i.getTime())/1e3,u=new o(null),d=u.timeAgoInWords(r);d&&(t=''+d+"")}if(t){var m=e.html.indexOf(">")+1,f=e.html.substring(0,m),g=e.html.substring(m);e.html=f+t+g}return s?s(l,e.html):(l.css("opacity","0"),setTimeout(function(){l.html(e.html).css("opacity","1")},1200)),h=e.entryId,p}},error:function(){a.trim(l.html())||(l.css("display","none"),c.css("visibility","visible"),d.stopPolling())}})})}}}),define("module/components/localLive",["module/bootstrap","module/request","module/featureDetector"],function(e,t,n){"use strict";var o=e.$,i={COMPONENT:"#comp-local-live",BUTTON:".local-live__progress-button",STICKY_WRAPPER:".sticky-wrapper",ARTICLE_WRAPPER:".article-wrapper",TOGGLE:".toggle"};return{handleSuccess:function(e){var s,a;this.localLive=o(e),this.stickyWrapper=this.localLive.find(i.STICKY_WRAPPER),this.articleWrapper=this.localLive.find(i.ARTICLE_WRAPPER),this.toggledElems=this.localLive.find(i.TOGGLE),this.canTransition=n.can("CssTransition"),this.button=o(i.BUTTON),a=this.localLive.data("live-event-channel")&&""!==this.localLive.data("live-event-channel")?this.localLive.data("live-event-channel"):null,this.localLive.data("polling-host")&&""!==this.localLive.data("polling-host")&&(s=this.localLive.data("polling-host")),s&&a&&(this.request=new t({getUpdatesOnInit:!0,url:this.constructPulsarUrl(s,a),success:o.proxy(this.handleRefreshSuccess,this),pending:o.proxy(this.handleRefreshPending,this),complete:o.proxy(this.handleRefreshComplete,this)}),this.bindEvents())},constructPulsarUrl:function(e,t){return e+"/news/walkietalkie/pulsar/"+t+"?sort=descending&limit=3&show=all"},handleRefreshSuccess:function(e){this.transition(o.proxy(function(){this.insertStickies(e.stickies),this.insertArticles(e.text)},this))},handleRefreshPending:function(){this.button.addClass("spinner")},handleRefreshComplete:function(){this.button.removeClass("spinner")},transition:function(e){this.canTransition?(this.toggledElems.one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",o.proxy(function(){e(),this.showUpdates()},this)),this.hideUpdates()):e()},insertStickies:function(e){var t,n="";for(t in e)e.hasOwnProperty(t)&&(n+=e[t]);this.stickyWrapper.html(n)},insertArticles:function(e){this.articleWrapper.html(e)},hideUpdates:function(){this.toggledElems.addClass("refreshing")},showUpdates:function(){this.toggledElems.removeClass("refreshing")},bindEvents:function(){this.button.on("click",o.proxy(function(e){this.request.getUpdates()},this))}}}),define("module/components/market_data/chart",["module/bootstrap","deviceInspector"],function(e,t){var n=e.$,o="group1",i="",s={group1:{height:171,width:304},group2:{height:171,width:304},group3:{height:343,width:610},group4:{height:363,width:645}},a=function(e){this.init(n(e))};return a.prototype.init=function(o){this.image=o.find(".markets-chart__image"),0!==this.image.length&&(this.imageUrl=this.image.data("chart-url"),i=this.image.data("chart-code"),this.timespans=o.find(".markets-chart__timespans"),this.timespanItems=o.find(".markets-chart_timespan-item"),this.timespans.on("click",".markets-chart_timespan-item",n.proxy(this.handleClick,this)),this.handleResize(t.getGroup()),e.pubsub.on("deviceGroup",n.proxy(this.handleResize,this)))},a.prototype.handleClick=function(e){return this.swapImage(e),this.toggleSelected(e),!1},a.prototype.swapImage=function(e){var t=e.target.getAttribute("data-timespan"),n=this.imageUrl.replace("CHART_TIMESPAN",t);this.track({chart_ticker:i,chart_timespan:t,chart_width:s[o].width,chart_height:s[o].height}),this.image.attr("src")!==n&&this.image.attr("src",n)},a.prototype.toggleSelected=function(e){this.timespanItems.removeClass("markets-chart_timespan-item--selected"),n(e.target).addClass("markets-chart_timespan-item--selected")},a.prototype.track=function(t){e.pubsub.emit("marketdata:chart:toggle",[t])},a.prototype.handleResize=function(e){o=e,this.imageUrl=this.imageUrl.replace("CHART_WIDTH",s[e].width).replace("CHART_HEIGHT",s[e].height),n(".markets-chart_timespan-item--selected").trigger("click")},a}),define("module/components/market_data/company_ticker_chart",["module/components/market_data/chart"],function(e){return{init:function(t){new e(t.selector)}}}),define("module/components/market_data/company_ticker_navigation",["module/bootstrap"],function(e){var t,n,o,i=e.$;return{init:function(e){t=i(e.selector),n=t.find(".markets-selector-item__link"),n.length<=1||(o=i(".company-ticker-top__market-panel"),o.hide().first().show(),t.on("click",".markets-selector-item__link",i.proxy(this.handleClick,this)))},handleClick:function(e){var t=i(e.target);return o.hide(),n.removeClass("markets-selector-item__link--selected"),i(t.attr("href")).show(),t.addClass("markets-selector-item__link--selected"),!1}}}),define("module/components/market_data/company_ticker_top",["module/bootstrap","module/components/market_data/chart"],function(e,t){var n=e.$;return{init:function(e){n(e.selector).find(".markets-chart").each(function(){new t(this)})}}}),define("module/components/market_data/index-selector",["module/bootstrap"],function(e){var t,n,o=e.$;return{init:function(){this.getElements(),t.addClass("hidden"),t.find("li").first().addClass("hidden"),n.on("click",this.toggleDropdown)},getElements:function(){t=o(".index-selector__indices"),n=o(".index-selector__main button")},toggleDropdown:function(e){e.preventDefault(),n.toggleClass("index-selector__toggle--open"),t.toggleClass("hidden")}}}),define("module/components/market_data/markets_index_chart",["module/components/market_data/chart"],function(e){return{init:function(t){new e(t.selector)}}}),define("module/components/scotland_decides/dropdown",["module/bootstrap"],function(e){var t,n,o,i,s,a,r,c,l,u,d,h=e.$;return{handleSuccess:function(e){this.component=e,this.setModule(),this.displayDropdown(),this.setupVars(),this.removeHeaderLink(),this.resetDropdown()},setModule:function(){t=h("#"+this.component.id)},setupVars:function(){n="#"+t.data("list"),o="#"+t.data("header"),c=t.data("button"),l=h("#"+c).text(),u=h("#"+c).data("close"),i="."+t.data("item"),s=t.data("item-selected"),a="."+s,r=t.data("open"),d=h("#page")},removeHeaderLink:function(){var e=h(o);e.html(e.find("a").html())},bindButtonEvent:function(){h("#"+c).one("click",h.proxy(this.toggleList,this))},bindHtmlEvent:function(){h("html").one("click",h.proxy(this.resetDropdown,this))},resetDropdown:function(){this.bindButtonEvent(),this.removeListOpenClass(),this.removeMinPageHeight(),this.hideNonSelectedItems(),this.changeButtonText(l)},hideNonSelectedItems:function(){h(n+" "+i+":not("+a+")").hide()},showAllItems:function(){h(n+" "+i).show()},changeButtonText:function(e){h("#"+c).find("span").html(e)},removeListOpenClass:function(){h(n).removeClass(r)},addListOpenClass:function(){h(n).addClass(r)},toggleList:function(){this.showAllItems(),this.addListOpenClass(),this.addMinPageHeight(),this.changeButtonText(u),setTimeout(h.proxy(this.bindHtmlEvent,this),0)},addMinPageHeight:function(){d.css("min-height",2050)},removeMinPageHeight:function(){d.css("min-height",0)},displayDropdown:function(){var e=t.find("script");t.append(e.html()),e.remove()}}}),define("module/components/market_data/markets_index_dropdown",["module/bootstrap","module/components/scotland_decides/dropdown"],function(e,t){return{init:function(e){t.handleSuccess({id:"comp-markets-index-dropdown"})}}}),define("module/components/mediaPlayer/mainAdapter",["module/components/mediaPlayer/main"],function(e){e.processNewPlayers()}),define("module/components/moreFromThisIndex",["module/bootstrap","module/timestamp","module/imageenhancer"],function(e,t,n){return{handleSuccess:function(o,i){var s,a=e.$(o.selector);a.find(".small-promo-group__body").html(i),s=new t(new Date((new Date).toUTCString()).getTime()),s.insertTime(),new n}}}),define("module/components/moreFromThisIndexAdapter",["module/bootstrap"],function(e){return{handleSuccess:function(t,n){if(n["comp-more-from-this-index"]&&n["comp-more-from-this-index"].html){var o=document.getElementById(t.elementId),i=e.$(o),s=n["comp-more-from-this-index"].html;i.find(".small-promo-group__body").html(s),require(["module/components/responsiveImage","module/components/timestampAdaptor"],function(e,n){var o="#"+t.elementId;e.reProcess(o),n.reProcess(o)})}}}}),define("module/stream/core",["module/bootstrap","module/stream/endpoint"],function(e,t){return function(n){var o=e.$({}),i=new t(n.latest,o,"latest"),s=new t(n.earlier,o,"earlier");return o.on("latest:request",function(){i.request()}),o.on("earlier:request",function(){s.request()}),o.on("latest:endpoints",function(e,t){s.setUrl(t.earlier)}),{emit:function(e){o.trigger(e)},on:function(e,t){o.on(e,function(){return t.apply(this,Array.prototype.slice.call(arguments,1))})}}}}),define("module/stream/view",["module/bootstrap","translator","module/featureDetector"],function(e,t,n){var o=e.$,i={refresh:'

    {{message}}

    ',showMore:'

    {{message}}

    '},s=function(e,t){return o.contains(e[0],t[0])},a=n.which("TransitionEnd"),r=function(e,t){n.can("CssTransition")?(e.on(a,function(){e.off(a),t(),e.removeClass("refreshing")}),e.addClass("refreshing")):t()};return function(e,n){var a=o({}),c=o(i.refresh.replace("{{message}}",t.get("streamRefreshError"))),l=o(i.showMore.replace("{{message}}",t.get("streamShowMoreError")));return e.on("latest:updates",function(e){r(n,function(){n.html(e),a.trigger("updates:inserted")}),s(n,c)&&c.remove()}),e.on("earlier:updates",function(e){var t=o.parseHTML(e),i=o("a",t)[0];n.append(t),i&&i.focus(),a.trigger("updates:inserted"),s(n,l)&&l.remove()}),e.on("latest:error",function(e){s(n,c)||n.prepend(c)}),e.on("earlier:error",function(e){s(n,l)||n.append(l)}),{on:function(e,t){a.on(e,function(){return t.apply(this,Array.prototype.slice.call(arguments,1))})}}}}),define("module/stream/refresh_button",["module/bootstrap","translator"],function(e,t){var n=e.$,o=['"].join(""),i={normal:t.get("streamRefreshButton")},s={loading:"spinner"};return function(){var e=n(o.replace("{{label}}",i.normal)),t=n({});return e.on("click",function(e){t.trigger("click")}),{appendTo:function(t){e.appendTo(t)},remove:function(){e.detach()},on:function(e,n){t.on(e,n)},setNormal:function(){e.removeClass(s.loading)},setLoading:function(){e.addClass(s.loading)}}}}),define("module/components/nexus/connectedStream",["module/stream/core","module/stream/view","module/stream/refresh_button","module/stream/show_more_button","module/bootstrap","module/featureDetector","module/imageenhancer","module/components/mediaPlayer/main"],function(e,t,n,o,i,s,a,r){"use strict";function c(e){return{latest:e.opts.endpoints.latest,earlier:e.opts.endpoints.earlier}}var l=i.$,u={init:function(e){return e.on("updates:inserted",l.proxy(this.run,this)),this},run:function(){this.publishTrackEvents(),this.createStatsData()},publishTrackEvents:function(){i.pubsub.emit("component:loaded",["connected-stream-internal"]),i.pubsub.emit("component:loaded",["connected-stream-external"])},createStatsData:function(){var e=l("#comp-connected-stream .update"),t=[".update__image",".update__headline",".update__body"];e.each(function(n,o){l(o).find("a").each(function(o,s){var a=l.grep(t,function(e){return l(s).closest(e).length>0}),r={update_index:n+1,update_total:e.length,update_type:l(s).closest(".update").attr("class"),update_position:a[0]};s.linktrack=i.$.param(r)})})}},d={init:function(e){return e.on("updates:inserted",l.proxy(this.run,this)),this},run:function(){r.processNewPlayers()}},h={init:function(e){return e.on("updates:inserted",l.proxy(this.run,this)),this},run:function(){ new a(".update__body img",".update__image img")}};return{handleSuccess:function(a){var r=l(a.selector),p=s.can("CssTransition"),m=new e(c(a)),f=new t(m,r.find(".updates")),g=new n,v=new o,b=l(".back-to-top");g.on("click",function(){m.emit("latest:request"),i.pubsub.emit("stream:refresh")}),m.on("latest:requesting",function(){g.setLoading()}),m.on("latest:updates",function(){g.setNormal()}),m.on("latest:error",function(){g.setNormal()}),g.appendTo(r.find(".comp-stream__header")),c(a).earlier&&(v.on("click",function(){m.emit("earlier:request"),i.pubsub.emit("stream:showmore")}),m.on("earlier:requesting",function(){v.setLoading()}),m.on("earlier:updates",function(){v.setNormal()}),m.on("earlier:noupdates",function(){v.remove()}),m.on("earlier:error",function(){v.setNormal()}),v.appendTo(r)),m.on("latest:endpoints",function(e){e.earlier&&v.appendTo(r)}),b.on("click",function(){i.pubsub.emit("stream:back-to-top")}),l("body").addClass(p?"css-anim":"animated-gif"),h.init(f).run(),d.init(f).run(),u.init(f).run()}}}),define("module/components/nexus/connectedStreamAdapter",["module/bootstrap","module/components/nexus/connectedStream"],function(e,t){var n=e.$,o=n("#comp-connected-stream");if(o.length){var i=o.data("compMeta");if(i){var s={id:i.id||"",type:i.type||"",handler:i.handler||"",deviceGroups:i.deviceGroups||null,loaded:!0,opts:{about:i.opts.about,title:i.opts.title,endpoints:{latest:i.opts.endpoints.latest,earlier:i.opts.endpoints.earlier}},selector:"#comp-connected-stream",template:i.template};t.handleSuccess(s)}}}),define("module/components/nexus/templates",{refresh:{button:'',error:'

    {{message}}

    '},show_more:{button:'',error:'

    {{message}}

    '}}),define("styleguide/queryString",[],function(){var e={},t=function(){var t="";for(var n in e)t+=t?"&"+n+"="+e[n]:"?"+n+"="+e[n];return t},n=function(t){return e[t]},o=function(t,n){e[t]=n},i=function(t,n){e.hasOwnProperty(t)||o(t,n)},s=function(t){delete e[t]};return function(){for(var t,n=window.location.search.substring(1),o=n?n.split("&"):[],i=0;i").attr("class","shoebill-image "+this.imageHiddenClass).attr("id","shoebill-image-"+o).append(t(n[o]).clone());this.$leadImageContainer.append(i)}},n.prototype.hidePlaceholderImage=function(){this.$leadImageContainer.children(".responsive-image:first").hide()},n.prototype.replaceUrls=function(){var e=this.$container.find(".group-title__link");e.length&&(this.$items.each(function(n){var o=e.attr("href")+"/"+t(this).data("asset-id");t(this).find("a").attr("href",o)}),this.$footer.find("a").attr("href",e.attr("href")))},n.prototype.updateLocationUrl=function(t){t&&(e.window.location.href=t)},n.prototype.showFooter=function(){this.$footer.removeClass(this.footerHiddenClass)},n.prototype.showImage=function(e){var n=t("#shoebill-image-"+e);n.length&&(this.$leadImageContainer.find(".shoebill-image").addClass(this.imageHiddenClass),n.removeClass(this.imageHiddenClass))},n.prototype.selectItem=function(e){this.currentIndex=e,this.showImage(e),this.$items.removeClass(this.itemSelectedClass),this.$items.eq(e).addClass(this.itemSelectedClass)},n.prototype.selectNextItem=function(){var e=this.currentIndex0?"container-shoebill.wide-only":"shoebill";this.view=new t({containerClass:e}),this.registerEventHandlers()};return n.prototype.registerEventHandlers=function(){e.pubsub.on("deviceGroup",$.proxy(this.handleResize,this))},n.prototype.handleResize=function(e){"group4"===e?this.view.isAnimated()||this.view.startTransition():this.view.stopTransition()},n}),define("module/components/shoebillAdapter",["module/components/shoebill/main"],function(e){new e}),define("module/components/socialEmbed/analytics",["istats-1"],function(e){"use strict";var t=function(){var e=document.getElementsByClassName("social-embed-post"),t="";if(e.length>0){for(var n=0;n-1;this.replaceUrls(e)},n.prototype.replaceUrls=function(e){var n,o,i=this.$link.attr("href");this.$items.each(function(s){(n=t(this).data("asset-id"))&&(o=i+"/"+n,e&&(o+="#video-"+n),t(this).find("a").attr("href",o))})},n}),define("module/components/spoonbill/main",["module/bootstrap","module/components/spoonbill/view"],function(e,t){var n=e.$;return function(){var e=[".container-spoonbill.wide-only",".container-spoonbill.compact-tablet-only"];n.each(e,function(e,o){n(o).length>0&&new t(n(o))}),n(".style-guide").length>0&&new t(n(".spoonbill"))}}),define("module/components/spoonbillAdapter",["module/components/spoonbill/main"],function(e){new e}),define("module/components/sport",["module/bootstrap","module/components/hardNewsUnit","translator"],function(e,t,n){var o=e.$;return{handleSuccess:function(e,n){this.selector=o(e.selector),this.teams=this.selector.find("#sport-teams").removeClass("hidden").hide(),this.sportStories=this.selector.find("#latest-sport-stories"),t.init(e.selector),this.sportStories.length&&this.teams.length&&this.renderTabs(),0===this.sportStories.length&&this.teams.length&&this.teams.show()},renderTabs:function(){this.selector.find("#latest-sport-stories").before(o('')),this.selector.addClass("has-tabs"),this.tabs=this.selector.find(".js-tabs-list li"),this.tabs.find("a").on("click",o.proxy(this.toggleTabs,this)),this.tabs.find("a").on("keydown",o.proxy(this.handleKeypress,this))},toggleTabs:function(e){this.selector.find(".js-tab-content").attr("aria-hidden","true").hide(),this.tabs.removeClass("open"),this.tabs.find("a").attr("tabindex","-1");var t=o("#"+e.target.href.split("#")[1]),n=o(e.target),i=n.parent();return this.tabs.find("span.off-screen").appendTo(n),i.addClass("open"),n.attr("tabindex","0"),t.attr("aria-hidden","false").show(),!1},handleKeypress:function(e){var t,n=o(e.target).parent(),i=n.next().find("a"),s=n.prev().find("a"),a=n.parent().find("a").first(),r=n.parent().find("a").last();e.which&&(39===e.which?t=i.length?i:a:37===e.which&&(t=s.length?s:r)),t&&(t.trigger("click"),t[0].focus())}}}),define("module/sport/sportView",["module/bootstrap","module/deviceInspector","translator"],function(e,t,n){var o,i=e.$,s=function(){},a=(i("#latest-sport-stories .sport-stories__more-button"),n.get("showMore")),r=n.get("showLess"),c=n.get("latestSportStories");return s.prototype={init:function(e,n){o=n||t.init(),this.selectorContainer=e instanceof i?e:i(e),this.headlineContainer=this.selectorContainer.find(".sport-stories__headline-stories"),0!==this.selectorContainer.length&&/group(1|2)/i.test(o.getGroup())&&(this.setUpStories(),this.button&&this.bindEvents())},setUpStories:function(){var e=this.selectorContainer.find(".sport-stories__headline-story");if(e.length>4&&/group(1|2)/i.test(o.getGroup())){e.slice(4).addClass("sport-stories__headline-story--toggle"),this.headlineContainer.addClass("sport-stories__headline-stories--hide"),this.appendButton()}},bindEvents:function(){i(window).on("resize",i.proxy(this.handleResize,this))},appendButton:function(){this.selectorContainer.find("#latest-sport-stories").append('"),this.button=i(".sport-stories__more-button"),this.button.on("click",i.proxy(this.handleButtonEvent,this))},handleButtonEvent:function(){this.toggleStories(),this.toggleButtonState()},toggleButtonState:function(){var e=this.button[0].childNodes[0];e.nodeValue===a?(e.nodeValue=r,this.selectorContainer.find("a.sport-stories__headline-story--toggle")[0].focus()):(e.nodeValue=a,this.button[0].focus())},toggleStories:function(){this.headlineContainer.toggleClass("sport-stories__headline-stories--hide")},handleResize:function(e){/group3|4/i.test(o.getGroup())?(this.headlineContainer.hasClass("sport-stories__headline-stories--hide")&&(this.toggleStories(),this.button[0].textContent===r+" "+c&&this.toggleButtonState()),this.button.css("display","none")):(0===i("#latest-sport-stories .sport-stories__more-button").length&&this.setUpStories(),this.headlineContainer.addClass("sport-stories__headline-stories--hide"),this.button.css("display","block"))}},s}),define("module/components/sportAdapter",["module/bootstrap","module/components/sport","module/sport/sportView"],function(e,t,n){if(e.$("#comp-sport-stories").length>0){var o=new n;t.handleSuccess(e.$("#comp-sport-stories")),o.init(e.$("#comp-sport-stories"))}}),define("module/components/sportBanner",["module/bootstrap"],function(e){var t=e.$;return{sessionStorageKey:"sport_banner_status",bannerHiddenKey:"hidden",bannerMinimisedKey:"min",selectors:{banner:".sport-banner__container",footer:"#orb-footer",refresh_button:".sport-banner__container .refresh-icon",close_button:".sport-banner__container .close-icon",expand_button:".sport-banner__container .expand-icon",scorecard_link:".sport-banner__container .full-scorecard-link",topic_link:".sport-banner__container .secondary-content"},classes:{banner_visible:"sport-banner__container--visible",banner_minimised:"sport-banner__container--minimised"},url:"/pattern-library-components?presenter=sport-banner&options[]",init:function(){e.pubsub.emit("sportBanner:loaded");var t="/hindi";window.config&&window.config.service&&(t="/"+window.config.service),this.url=t+this.url,this.bannerSetup()},bannerSetup:function(){var n=this;t(this.selectors.close_button).on("click",function(t){t.preventDefault(),t.stopPropagation(),e.pubsub.emit("sportBanner:closeButton:clicked"),n.disableBanner()}),t(this.selectors.expand_button).on("click",function(e){e.preventDefault(),e.stopPropagation(),n.toggleMinMax()}),t(this.selectors.refresh_button).on("click",function(t){t.preventDefault(),t.stopPropagation(),e.pubsub.emit("sportBanner:refreshButton:clicked"),n.refreshBanner()}),t(this.selectors.scorecard_link).on("click",function(t){t.stopPropagation(),e.pubsub.emit("sportBanner:fullScorecard:clicked")}),t(this.selectors.topic_link).on("click",function(t){t.stopPropagation(),e.pubsub.emit("sportBanner:topicLink:clicked")}),this.shouldShowBanner()&&this.showBanner()},hideBanner:function(){this.hideLoader(),t(this.selectors.banner).removeClass(this.classes.banner_visible),this.bannerUpdated()},showBanner:function(){this.hideLoader(),this.shouldMinimiseBanner()&&this.minimiseBanner(),t(this.selectors.banner).addClass(this.classes.banner_visible),this.bannerUpdated()},setBannerStatus:function(e){if(window.sessionStorage){if(!e)return void sessionStorage.removeItem(this.sessionStorageKey);sessionStorage.setItem(this.sessionStorageKey,e)}},toggleMinMax:function(){if(this.isBannerMinimised())return e.pubsub.emit("sportBanner:expandButton:clicked"),this.maximiseBanner(),void this.setBannerStatus();e.pubsub.emit("sportBanner:collapseButton:clicked"),this.minimiseBanner(),this.setBannerStatus(this.bannerMinimisedKey)},minimiseBanner:function(){var e=this;t(this.selectors.banner).addClass(this.classes.banner_minimised),t(this.selectors.banner).on("click",function(t){t.preventDefault(),e.toggleMinMax()}),this.bannerUpdated()},maximiseBanner:function(){t(this.selectors.banner).removeClass(this.classes.banner_minimised),t(this.selectors.banner).off("click"),this.bannerUpdated()},disableBanner:function(){this.hideBanner(),t(this.selectors.banner).off("click"),this.setBannerStatus(this.bannerHiddenKey)},shouldShowBanner:function(){return!window.sessionStorage||sessionStorage.getItem("sport_banner_status")!==this.bannerHiddenKey},shouldMinimiseBanner:function(){return!!window.sessionStorage&&sessionStorage.getItem("sport_banner_status")===this.bannerMinimisedKey},isBannerMinimised:function(){return t(this.selectors.banner).hasClass(this.classes.banner_minimised)},showLoader:function(){t(this.selectors.banner).css({opacity:.85})},hideLoader:function(){t(this.selectors.banner).css({opacity:1})},refreshBanner:function(){var e=this;this.showLoader(),t.ajax({url:this.url,dataType:"json",success:function(n){if(n.html){t(n.html).is(e.selectors.banner)&&(t(e.selectors.banner).replaceWith(t(n.html)),e.bannerSetup())}},error:function(){e.hideLoader()}})},bannerUpdated:function(){var e=0,n=t(this.selectors.banner).first();n&&"none"!==n.css("display")&&(e=t(this.selectors.banner).height()),t(this.selectors.footer).css({"margin-bottom":e})}}}),define("module/components/stickyPlayer/main",["module/bootstrap"],function(e){"use strict";var t=e.$,n={stickyPlayer:".sticky-player",player:".sticky-player__player",closeButton:".sticky-player__close-button"},o={enabled:"sticky-player--enabled",pinned:"sticky-player--pinned",visible:"sticky-player--visible"},i=function(o,i,s){s=s||{},this.mediaPlayerDomId="media-player",this.stickyPlayerDomId="sticky-player",i>0&&(this.mediaPlayerDomId+="-"+i,this.stickyPlayerDomId+="-"+i),this.state={enabled:!1,pinned:!1,visible:!1},this.isTouchDevice=s.isTouchDevice||!1,this.isTouchEvent=!1,this.scrollThreshhold=300,this.scrollHandler=this.throttle(this.onWindowScroll,this.scrollThreshhold,this),this.showTimerId=null,this.isDebug=document.location&&null!==document.location.search.match(/debug=1/),this.wrapPlayer(t(o)),this.$window=t(e.window),this.$body=t("body"),this.$container=t("#"+this.stickyPlayerDomId),this.$player=this.$container.find(n.player),this.$closeButton=this.$container.find(n.closeButton),this.$placeholder=t("#"+this.stickyPlayerDomId+"-placeholder")};return i.prototype.bindEvents=function(){this.$window.on("scroll",this.scrollHandler),this.$container.on("click",t.proxy(this.onContainerClick,this)),this.$player.on("click",t.proxy(this.onPlayerClick,this)),this.$closeButton.on("click",t.proxy(this.onExitButtonClick,this)),this.isTouchDevice&&(this.$window.on("touchstart",t.proxy(this.onTouchStart,this)),this.$window.on("touchend",t.proxy(this.onTouchEnd,this)))},i.prototype.unbindEvents=function(){this.$window.off("scroll",this.scrollHandler),this.$container.off("click"),this.$player.off("click"),this.$closeButton.off("click"),this.isTouchDevice&&(this.$window.off("touchstart",t.proxy(this.onTouchStart,this)),this.$window.off("touchend",t.proxy(this.onTouchEnd,this)))},i.prototype.onWindowScroll=function(e){this.isEnabled()&&!this.isTouchEvent&&(this.updatePosition(),this.log("scrolled"))},i.prototype.onContainerClick=function(e){e.stopPropagation(),this.isEnabled()&&this.isVisible()&&this.scrollPlayerIntoView()},i.prototype.onPlayerClick=function(e){e.stopPropagation()},i.prototype.onExitButtonClick=function(e){e.stopPropagation(),this.disable()},i.prototype.onTouchStart=function(e){this.isTouchEvent=!0,this.clearTimeout("showTimerId")},i.prototype.onTouchEnd=function(e){this.isTouchEvent=!1,this.updatePosition()},i.prototype.enable=function(){!this.isEnabled()&&this.$container.length>0&&(this.bindEvents(),this.$body.addClass(n.stickyPlayer.substring(1)),this.$container.addClass(o.enabled),this.state.enabled=!0,this.log("enabled"))},i.prototype.disable=function(){this.isEnabled()&&(this.hide(),this.unbindEvents(), this.getNumberOfPlayersEnabled()<=1&&this.$body.removeClass(n.stickyPlayer.substring(1)),this.$container.removeClass(o.enabled),this.state.enabled=!1,this.log("disabled"))},i.prototype.isEnabled=function(){return this.state.enabled},i.prototype.getNumberOfPlayersEnabled=function(){return t("."+o.enabled).length},i.prototype.updatePosition=function(){if(this.isEnabled()&&!this.isTouchEvent)if(this.isPlayerInViewport())(this.isPinned()||this.isVisible())&&this.hide();else if(this.isPinned()||this.pin(),!this.isVisible()){var e=this.isTouchDevice?this.scrollThreshhold+100:100;this.setTimeout(this.show,"showTimerId",e)}},i.prototype.setTimeout=function(n,o,i){this.clearTimeout(o),this[o]=e.window.setTimeout(t.proxy(n,this),i)},i.prototype.clearTimeout=function(t){e.window.clearTimeout(this[t]),this[t]=null},i.prototype.show=function(){this.isPinned()||this.pin(),this.$container.addClass(o.visible),this.state.visible=!0,this.log("visible")},i.prototype.hide=function(){this.unpin(),this.$container.removeClass(o.visible),this.state.visible=!1,this.log("hidden")},i.prototype.isVisible=function(){return this.state.visible},i.prototype.pin=function(){this.isPinned()||(this.showPlaceholderElement(),this.$container.addClass(o.pinned),this.state.pinned=!0)},i.prototype.unpin=function(){this.isPinned()&&(this.hidePlaceholderElement(),this.$container.removeClass(o.pinned),this.state.pinned=!1)},i.prototype.isPinned=function(){return this.state.pinned},i.prototype.isPlayerInViewport=function(){var e,t,n,o;return e=this.isPinned()?this.$placeholder.get(0).getBoundingClientRect():this.$container.get(0).getBoundingClientRect(),t=this.$window.height(),n=e.top>=0&&e.top0&&e.bottom<=t,n||o},i.prototype.renderTemplate=function(e){var n='

    {{title}}

    ';for(var o in e)n=n.replace(new RegExp("{{"+o+"}}","ig"),e[o]);return t(n)},i.prototype.wrapPlayer=function(e){var o,i;o=this.getPlayableData(e),i=this.renderTemplate({class:n.stickyPlayer.substring(1),id:this.stickyPlayerDomId,title:t("
    ").text(o.title).html()}),e.hasClass("media-player")&&(e.replaceWith(i),i.find(n.stickyPlayer+"__player").append(e),this.log("wrapped around "+this.mediaPlayerDomId))},i.prototype.getPlayableData=function(e){var t=e.data("playable");return t&&t.settings&&t.settings.playlistObject?t.settings.playlistObject:{}},i.prototype.showPlaceholderElement=function(){this.$placeholder.css({height:this.$player.height()}).addClass("sticky-player__image--visible")},i.prototype.hidePlaceholderElement=function(){this.$placeholder.removeClass("sticky-player__image--visible")},i.prototype.scrollPlayerIntoView=function(){this.$placeholder.get(0).scrollIntoView?this.$placeholder.get(0).scrollIntoView():e.window.location.href="#"+this.$placeholder.attr("id")},i.prototype.throttle=function(t,n,o){n=n||100;var i,s;return function(){var a=o||this,r=+new Date,c=arguments;i&&r0&&(this.registerEventHandlers(),this.initInViewDetector())};return i.prototype.registerEventHandlers=function(){e.pubsub.on("module:in:view",o.proxy(this.handleModuleInView,this))},i.prototype.handleModuleInView=function(e){this.el.get(0)===o(e).get(0)&&this.view.startAnimation()},i.prototype.initInViewDetector=function(){n.register("titanis"),n.checkModulesInView()},i}),define("module/components/titanisAdapter",["module/components/titanis/main"],function(e){new e(".titanis")}),define("module/components/topStories",["module/bootstrap","module/components/liveEventPromo","module/components/hardNewsUnit","module/components/localLive"],function(e,t,n,o){return{handleSuccess:function(i){var s=e.$(i.selector);n.init(i.selector),s.hasClass("js-has-live-event-promo")&&t.handleSuccess(),s.hasClass("js-has-local-live-promo")&&o.handleSuccess("#comp-local-live")}}}),define("module/components/topStoriesAdapter",["module/components/topStories"],function(e){e.handleSuccess({selector:"#top-stories"})}),define("module/components/topicalStories",["module/components/hardNewsUnit"],function(e){return{handleSuccess:function(t){e.init(t.selector)}}}),define("module/components/twite/analytics",[],function(){"use strict";var e=!1,t={clicked:"twite:shareTools:clicked"};return{init:function(){try{e=window.bbcdotcom&&bbcdotcom.config.isAnalyticsEnabled()}catch(e){}},track:function(n,o){if(e){if(!t[n])throw'Event name "'+n+'" not defined';var i=t[n],s=o||{};try{bbcdotcom.trackEvent(i,s)}catch(e){}}}}}),define("module/components/twite/view",["module/bootstrap","module/featureDetector","vendor/lo-dash/lo-dash"],function(e,t,n){"use strict";var o,i={shareButton:".twite__share-button",closeButton:".twite__close-button",panel:".twite__panel",channelLink:".twite__channel-link",extractedLink:".extracted__channel-link",shareLink:".twite__share-link",container:".container-twite",miniInfoTimestamp:".mini-info-list-wrap",miniInfoTwite:".share-tools--no-event-tag",twiteListMobileElements:".twite__channel-out--mobile"},s=e.$,a=function(){l(),O(),o=s("#page"),r()},r=function(){var e=s(i.miniInfoTimestamp).width(),t=s(i.miniInfoTimestamp).parent().width(),n=t-e-44;s(i.miniInfoTwite).width()>n&&c(n)},c=function(e){var t=s(i.twiteListMobileElements).length;if(t)for(var n=s(i.twiteListMobileElements),o=t-Math.floor(e/44),a=1;a<=o;a++)n.length>=a&&n[t-a].remove()},l=function(){s(i.shareButton).on("click",u),s(i.channelLink).on("click",m),s(i.extractedLink).on("click",f),s(i.panel).on("click",g),s(i.closeButton).on("click",p),s(i.shareLink).on("click",v),s(window).on("resize",r),e.pubsub.on("timestamp:relative:done",r),s("html").on("click",b),H()},u=function(e){e.preventDefault(),e.stopPropagation();var t=s(this).next();"visible"===t.css("visibility")?C(t):(x(),T(t),y(t)),d()},d=function(){s(i.shareButton).each(function(){var e=s(this).next();s(this).attr("aria-expanded","visible"===e.css("visibility"))})},h=function(){return document.getElementsByClassName("direction").length>0&&"rtl"===document.getElementsByClassName("direction")[0].getAttribute("dir")},p=function(e){e.preventDefault(),e.stopPropagation(),C(s(this).parent()),d()},m=function(t){t.stopPropagation();var n=s(this).closest(i.panel).prev(),o=s(this).find("span").attr("data-platform"),a=n.data("origin");e.pubsub.emit("shareTools:channel:clicked",[o,a]),e.pubsub.emit("shareTools:"+o+":clicked")},f=function(t){t.stopPropagation();var n=s(this).find("span").attr("data-platform");n="extracted"+n,e.pubsub.emit("shareTools:channel:clicked",[n,"page"]),e.pubsub.emit("shareTools:"+n+":clicked")},g=function(e){e.stopPropagation()},v=function(e){e.preventDefault(),e.stopPropagation(),$(s(this))},b=function(e){x()},y=function(e,t){e.addClass("show"),o.length&&_(I(e)-P()),w()},w=function(){s(window).on("resize.twite",n.debounce(function(){var e=s(i.panel+".show");o.length&&_(I(e)-P())},150))},_=function(e){o.length&&o.css("min-height",e)},k=function(){_(0),s(window).off("resize.twite")},C=function(e){S(e),e.prev()[0].focus(),k()},x=function(){S(s(i.panel)),k()},S=function(e){e.removeClass().addClass("twite__panel")},T=function(e){var t="arrow-top-right";h()?R()?M()?(e.css("top",-(A(e)+31)),e.css("right",0),t="arrow-bottom-left"):(e.css("top",-(A(e)+31)),e.css("left",0),t="arrow-bottom-right"):M()?(e.css("right",0),t="arrow-top-left"):(e.css("left",0),t="arrow-top-right"):R()?D()?(e.css("top",-(A(e)+31)),e.css("left",0),t="arrow-bottom-left"):(e.css("top",-(A(e)+31)),e.css("right",0),t="arrow-bottom-right"):D()?(e.css("left",0),t="arrow-top-left"):(e.css("right",0),t="arrow-top-right"),e.addClass(t)},P=function(){return parseInt(o.offset().top,10)-20},E=function(e){return parseInt(e.offset().top,10)},I=function(e){return E(e)+A(e)},A=function(e){return parseInt(e.css("height"),10)},L=function(e,t){N(e,t),B(e,t)},N=function(e,t){e.find(i.channelLink).each(function(e){var n=t.find(i.channelLink).eq(e);s(this).attr("href")!==n.attr("href")&&n.attr("href",s(this).attr("href"))})},B=function(e,t){var n=e.find(i.panel).data("share-uri"),o=window.location.protocol+"//"+window.location.hostname+n;t.find(i.shareLink).attr("href",o).text(o)},$=function(e){document.execCommand("selectAll",!1,e.get(0))},R=function(){return s(i.shareButton).offset().top>s(i.panel).height()+50},D=function(){return s(i.shareButton).offset().left+s(i.panel).width()s(i.panel).width()},H=function(){s("#site-container").on("focus","#page",function(e){0===s(i.container).has(e.target).length&&(x(),d())})},O=function(){s(".sharetools").addClass("sharetools--reveal"),t.is("TouchDevice")||(s(".twite__channel-out--messengermobile").addClass("messenger-hide"),s(".twite__channel--messengermobile").addClass("messenger-hide"),s(".twite__channel-out--messengerdesktop").addClass("messenger-show"),s(".twite__channel--messengerdesktop").addClass("messenger-show"),s(".twite__channel-out--kakaostory").addClass("messenger-show"))};return{init:a,hidePanels:x,copyLinks:L,selectShareLink:$,checkSpacing:r}}),define("module/components/twite/handler",["module/bootstrap","module/components/twite/view","module/components/twite/analytics"],function(e,t,n){"use strict";var o=(e.$,function(){e.pubsub.on("shareTools:channel:clicked",i),e.pubsub.on("shareTools:links:update",s),e.pubsub.on("shareTools:panels:close",a)}),i=function(e,t){n.track("clicked",{platform:e,origin:t})},s=function(e,n){t.copyLinks(e,n)},a=function(){t.hidePanels()};return{init:function(){t.init(),n.init(),o()}}}),define("module/components/twiteAdapter",["module/components/twite/handler"],function(e){e.init()}),define("module/components/vocabWidget",["module/bootstrap","module/cookieUtils"],function(e,t){function n(e){var t;try{var n=n;t=new n("keypress",{bubbles:!0,cancelable:!1}),t.keyCode=e}catch(n){t=document.createEvent("Event"),t.initEvent("keypress",!0,!1),t.keyCode=e}return t}function o(e,t){e.dispatchEvent(t)}function i(){var e=y(".gwt-ToggleButton"),t=n(I);e[0].focus(),s(),o(e[0],t),k.toggleClass(P),v()}function s(){y(".translate").toggleClass("user-select-none")}function a(e,t,n){("string"==typeof e?y(e):e).attr(t,n)}function r(e){var n=!(!y(e).hasClass(E)&&!y(e).hasClass(P));t.setCookie(S,n)}function c(e){_.addClass("vocab-alert--show"),_.find(".vocab-alert__text").html(e)}function l(){_.removeClass("vocab-alert--show")}function u(e){d(e,C)?w.emit("vocab:clicked:enabled"):w.emit("vocab:clicked:disabled")}function d(e,t){return!1===t||y(e).hasClass(P)}function h(){y("body").on("click",T,function(){C?i():(g(),b()),u(this),r(this)})}function p(){y("body").on("click",".vocab_link",function(e){return e.stopPropagation(),!1})}function m(){y("body").on("click",".gwt-DecoratedPopupPanel .popupTopRightInner",function(e){y(".gwt-DecoratedPopupPanel").css({visibility:"hidden",display:"none"})})}function f(){y("body").on("click",".vocab-alert__close",function(){l()})}function g(){k.addClass(E)}function v(){k.removeClass(E)}function b(){!1===C&&require(["vendor/vocab/vocabKickoff"],function(){})}var y=e.$,w=e.pubsub,_=y(".js-vocab-alert"),k=y(".js-vocab-toggle"),C=!1,x=5e3,S="ckps_vocab_cf",T=".js-vocab-toggle",P="vocab-toggle--active",E="vocab-toggle--loading",I=13;return window.onVocabReady=function(){setTimeout(function(){y(".vocab-tool").addClass("vocab-tool--show"),a(T,"aria-disabled",!1),i(),C=!0},x)},window.onVocabError=function(e){a(T,"aria-disabled",!0),t.setCookie(S,!1),c(e),v(),w.emit("vocab:error",[e])},function(){return"true"===t.readCookie(S)}()&&(g(),w.emit("vocab:cookie:vocab-enabled"),b()),function(){window.vocabConfig={language:"cy",start:"#page",apikey:k.data("vocab-key")}}(),function(){h(),p(),m(),p(),f()}(),{setTimeoutValue:function(e){x=e}}}),define("vendor/locator/main",["module/bootstrap","locator/locatorView","locator/stats"],function(bootstrap,LocatorView,Stats){function doRequest(url,success,actionType,complete){"function"==typeof complete&&(complete=function(){}),bootstrap.ajax({url:url,dataType:"json",method:"get",complete:complete,success:success,error:function(e){var responseText,response;responseText=e&&e.responseText?e.responseText:"{}";try{response=window.JSON?window.JSON.parse(responseText):eval("("+responseText+")")}catch(e){response=null}bootstrap.pubsub.emit("locator:error",[response,actionType])}})}function normaliseCoordinate(e){return String(Math.round(1e3*e)/1e3)}var Locator,newsMap={3:"england/berkshire",4:"england/birmingham_and_black_country",7:"england/bristol",8:"england/cambridgeshire",11:"england/cornwall",12:"england/coventry_and_warwickshire",13:"england/cumbria",16:"england/derbyshire",17:"england/devon",18:"england/dorset",19:"scotland/edinburgh_east_and_fife",20:"england/essex",22:"scotland/glasgow_and_west",23:"england/gloucestershire",26:"world/europe/guernsey",27:"england/hampshire",28:"england/hereford_and_worcester",30:"scotland/highlands_and_islands",31:"england/humberside",32:"world/europe/isle_of_man",33:"world/europe/jersey",34:"england/kent",35:"england/lancashire",36:"england/leeds_and_west_yorkshire",37:"england/leicester",38:"england/lincolnshire",39:"england/merseyside",40:"england/london",41:"england/manchester",42:"wales/mid_wales",43:"england/norfolk",44:"england/northamptonshire",45:"scotland/north_east_orkney_and_shetland",46:"wales/north_east_wales",21:"northern_ireland",47:"wales/north_west_wales",49:"england/nottingham",50:"england/oxford",57:"england/south_yorkshire",51:"england/shropshire",52:"england/somerset",53:"wales/south_east_wales",55:"scotland/south_scotland",56:"wales/south_west_wales",58:"england/stoke_and_staffordshire",59:"england/suffolk",66:"england/surrey",60:"england/sussex",61:"scotland/tayside_and_central",62:"england/tees",1:"england/beds_bucks_and_herts",63:"england/tyne_and_wear",65:"england/wiltshire",48:"england/york_and_north_yorkshire"},newsRegionsMap={56:"South West Wales",28:"Hereford & Worcester",36:"Leeds and Bradford",60:"Sussex",61:"Tayside & Central Scotland",62:"Tees",63:"Tyne and Wear",35:"Lancashire",66:"Surrey",34:"Kent",26:"Guernsey",27:"Hampshire",20:"Essex",21:"Northern Ireland",48:"York & North Yorkshire",49:"Nottinghamshire",46:"North East Wales",47:"North West Wales",44:"Northampton",45:"North East Scotland Orkney & Shetland",42:"Mid Wales",43:"Norfolk",40:"London",41:"Manchester",1:"Beds Herts & Bucks",3:"Berkshire",4:"Birmingham and Black Country",7:"Bristol",8:"Cambridgeshire",13:"Cumbria",12:"Coventry & Warwickshire",30:"Highlands & Islands",58:"Stoke & Staffordshire",11:"Cornwall",39:"Liverpool",38:"Lincolnshire",59:"Suffolk",22:"Glasgow & West of Scotland",17:"Devon",16:"Derby",19:"Edinburgh Fife & East of Scotland",18:"Dorset",31:"Humberside",23:"Gloucestershire",51:"Shropshire",50:"Oxford",53:"South East Wales",52:"Somerset",33:"Jersey",55:"South Scotland",37:"Leicestershire",32:"Isle of Man",57:"Sheffield & South Yorkshire",65:"Wiltshire"},newsTldMap={56:"southwestwales",42:"midwales",50:"oxford",60:"sussex",61:"taysideandcentralscotland",62:"tees",63:"tyne",49:"nottingham",66:"surrey",52:"somerset",53:"southeastwales",26:"guernsey",27:"hampshire",20:"essex",21:"northernireland",22:"glasgowandwestscotland",23:"gloucestershire",46:"northeastwales",47:"northwestwales",44:"northampton",45:"northeastscotlandnorthernisles",28:"herefordandworcester",43:"norfolk",40:"london",41:"manchester",1:"threecounties",3:"berkshire",4:"birmingham",7:"bristol",8:"cambridgeshire",39:"liverpool",38:"lincolnshire",58:"stoke",11:"cornwall",51:"shropshire",13:"cumbria",12:"coventry",59:"suffolk",48:"york",17:"devon",16:"derby",19:"edinburghandeastscotland",18:"dorset",31:"humberside",30:"highlandsandislands",37:"leicester",36:"leeds",35:"lancashire",34:"kent",33:"jersey",55:"southscotland",32:"isleofman",57:"sheffield",65:"wiltshire"},nationsMap={e:"england",n:"northernireland",s:"scotland",w:"wales"};return Locator=function(e){var t,n,o,i,s;t=this,o=!1,e=e||{},this.host=e.host||"",this.getLocation(),this.action="",e.pubsub&&(bootstrap.pubsub=e.pubsub),this._persistLocation=e.persistLocation||!1,s=!!e.confirmLocationSelection,this.confirmLocationSelection=s,i=new Stats(bootstrap.pubsub),i.applyEvents(),bootstrap.pubsub.on("locator:open",function(i){if(!o){o=!0,n=new LocatorView(i,{enableReverseGeocode:!1!==e.enableReverseGeocode,enableAutoComplete:!1!==e.enableAutoComplete}),t.location&&!0===t._persistLocation?bootstrap.pubsub.emit("locator:renderChangePrompt"):bootstrap.pubsub.emit("locator:renderForm");var a=t.getNewsRegionChoices();a.length>1&&(bootstrap.pubsub.emit("locator:renderForm"),bootstrap.pubsub.emit("locator:newsLocalRegions",[{location:{id:t.location.id},regions:a}])),bootstrap.pubsub.on("locator:locationSelected",function(e){s?"geolocate"===t.action?n.renderGeolocationResult(e):0===n.results.children.length&&n.renderSearchResults({results:[e]}):n.resetForm()}),bootstrap.pubsub.on("locator:newsLocalRegions",function(){s&&n.setMoreResultsDisplay("none")})}}),bootstrap.pubsub.on("locator:close",function(e){o&&(o=!1,n.close(),n=null)}),bootstrap.pubsub.on("locator:geoLocation",function(e){t.geoLocate(e.coords.latitude,e.coords.longitude)}),bootstrap.pubsub.on("locator:submitSearch",function(e,n){t.search(e,n)}),bootstrap.pubsub.on("locator:submitLocation",function(e,n){t.checkLocation(e,n)}),bootstrap.pubsub.on("locator:submitAutoCompleteSearch",function(e){t.autoComplete(e)}),bootstrap.pubsub.on("locator:submitAutoCompleteLocation",function(e,n){t.checkLocation(e,null)})},Locator.prototype.open=function(e){bootstrap.pubsub.emit("locator:open",[e])},Locator.prototype.close=function(){bootstrap.pubsub.emit("locator:close")},Locator.prototype.handleLocation=function(e){this.locationSelection=e,!0===this._persistLocation?(this.persistLocation(e),bootstrap.pubsub.emit("locator:renderChangePrompt"),bootstrap.pubsub.emit("locator:locationChanged",[this.getLocation()])):bootstrap.pubsub.emit("locator:locationSelected",[e])},Locator.prototype.checkLocation=function(e,t){var n=this,o=this.host+"/locator/news/responsive/location.json?id="+e;this.confirmLocationSelection||bootstrap.pubsub.emit("locator:renderWait"),t&&(o+="&newsRegion="+t),doRequest(o,function(e){n.handleResponse(e)},"location")},Locator.prototype.handleResponse=function(e){"search_results"===e.type?bootstrap.pubsub.emit("locator:searchResults",[e]):"autocomplete_search_results"===e.type?bootstrap.pubsub.emit("locator:autoCompleteSearchResults",[e]):"news_regions"===e.type?bootstrap.pubsub.emit("locator:newsLocalRegions",[e]):"geolocation"===e.type?e.isWithinContext||bootstrap.pubsub.emit("locator:locationOutOfContext",[e]):"location"===e.type&&this.handleLocation(e)},Locator.prototype.setLocServCookie=function(e){var t,n;e=e||{},"location"===e.type&&e.cookie&&e.expires&&!1!==(n=this.getCookieDomain(window.location.hostname))&&(t="locserv="+e.cookie+"; expires="+new Date(1e3*e.expires).toUTCString()+"; path=/; domain="+n,this.setCookieString(t),this.hasParsedCoookie=!1)},Locator.prototype.getCookieDomain=function(e){var t;return"string"==typeof e&&(!(!(t=e.match(/bbc\.co(\.uk|m)$/))||2!==t.length)&&"."+t[0])},Locator.prototype.persistLocation=function(e,t){var n,o;if(!1!==this._persistLocation)return o=this,!e&&!t&&"object"==typeof this.locationSelection||"object"==typeof e&&e===this.locationSelection?void this.setLocServCookie(this.locationSelection):e&&t?(e=e.toString(),this.locationSelection&&this.locationSelection.id===e&&this.locationSelection.news.id===t?void this.setLocServCookie(this.locationSelection):(n=this.host+"/locator/news/responsive/location.json?id="+e,n+="&newsRegion="+t,void doRequest(n,function(e){o.setLocServCookie(e)},"location"))):void("object"==typeof e&&this.setLocServCookie(e))},Locator.prototype.search=function(e,t){var n=this.host+"/locator/news/responsive/search.json?search="+encodeURIComponent(e),o=this;this.action="search",t&&(n+="&offset="+t),bootstrap.pubsub.emit("locator:renderWait"),doRequest(n,function(e){o.handleResponse(e)},"search")},Locator.prototype.autoComplete=function(e){var t=this;doRequest(this.host+"/locator/news/responsive/autocomplete.json?search="+e,function(e){t.handleResponse(e)},"autocomplete")},Locator.prototype.geoLocate=function(e,t){var n=this.host+"/locator/news/responsive/geolocate.json?latitude="+normaliseCoordinate(e)+"&longitude="+normaliseCoordinate(t),o=this;this.action="geolocate",bootstrap.pubsub.emit("locator:renderWait"),doRequest(n,function(e){o.handleResponse(e)},"geolocate")},Locator.prototype.getCookieString=function(){return document.cookie},Locator.prototype.setCookieString=function(e){document.cookie=e},Locator.prototype.getNewsRegionChoices=function(){var e,t,n,o;if(n=[],t=this.getCookieString().match(/locserv=[\w\W]*?(r=([\d+\.?]+))[;|\s|$]?/))for(e=t[2].split("."),o=0;o{{title}}'.replace("{{link}}","/news/"+t).replace("{{title}}",o.attr("data-title")),this.moduleTitle.html(n))},setContent:function(e,i){i&&(e='
    '+(e||"")+"
    "),this.container.html(e);new n,new t(new Date((new Date).toUTCString()).getTime());o.init("#local-stories")},hideLocal:function(){this.container.addClass("hidden")},showLocal:function(){this.container.removeClass("hidden")}},a}),define("module/weather/weather",["module/bootstrap"],function(e){var t=function(t){this.options=t||{},this.options.type=this.options.type||"hourly",this.options.append_ext=this.options.append_ext||void 0,e.pubsub.on("weather:locationChanged",e.$.proxy(this.updateWeather,this))};return t.prototype.updateWeather=function(t){t&&t.id&&(this.url=e.config.pathPrefix+"/weather/"+t.id.toString().toLowerCase()+"/"+this.options.type,e.pubsub.emit("weather:requestStarted"),e.$.ajax({url:this.url+(void 0!==this.options.append_ext?this.options.append_ext:""),type:"get",dataType:"html",success:function(n){e.pubsub.emit("weather:success",[n,t])},error:function(t){e.pubsub.emit("weather:requestError",[t])}}))},t}),define("module/weather/weatherView",["module/bootstrap"],function(e){var t=function(t){this.container=e.$(t),this.container.length&&(this.weatherLinkHref=this.container.attr("href"),this.hideWeather(),e.pubsub.on("weather:success",e.$.proxy(this.handleSuccess,this)),e.pubsub.on("weather:requestError",e.$.proxy(this.handleError,this)))};return t.prototype={setContent:function(e){this.container.html(e)},setLink:function(e){return e=e||"",this.weatherLinkHref+"/"+e.toString().toLowerCase()},setLocationName:function(t){if(void 0!==t){var n=e.$(".weather-location");n.length&&n.html('

    '+t+" weather

    ")}}, handleSuccess:function(e,t){this.setContent(e),this.location=t,this.container.attr("href",this.setLink(this.location.id)),this.showWeather(),this.setLocationName(this.location.name),this.highlightDropdownButton()},handleError:function(){this.hideWeather()},showWeather:function(){this.container.removeClass("hidden")},hideWeather:function(){this.container.addClass("hidden")},highlightDropdownButton:function(){e.$(".weather-location__show-locations").on("mouseenter",function(){e.$(".weather-location__current").addClass("hover")}).on("mouseleave",function(){e.$(".weather-location__current").removeClass("hover")}).on("keyup",function(t){9===(t.keyCode||t.which)&&e.$(".weather-location__current").addClass("hover")}).on("blur",function(){e.$(".weather-location__current").removeClass("hover")})}},t}),define("module/weather/weatherLocation",["module/bootstrap"],function(e){var t=function(){this.retrieveWeatherItems()};return t.prototype={retrieveWeatherItems:function(){e.pubsub.emit("weatherLocation:requestStarted");var t=window.location.pathname,n=e.config.pathPrefix+"/weather/regions"+t.toLowerCase();e.$.ajax({url:n,type:"get",dataType:"html",success:function(t){e.pubsub.emit("weatherLocation:success",[t])},error:function(t){e.pubsub.emit("weatherLocation:requestError",[t])}})}},t}),define("module/weather/weatherLocationView",["module/bootstrap","deviceInspector"],function(e,t){var n=function(t){this.container=e.$(t),this.weatherModule=e.$(".weather-forecast"),this.container.length&&(this.hideWeatherLocation(),e.pubsub.on("weatherLocation:success",e.$.proxy(this.handleSuccess,this)),e.pubsub.on("weatherLocation:requestError",e.$.proxy(this.handleError,this)))};return n.prototype={insertWeatherLocationDropdown:function(t){this.container.append(t),e.$(".weather-location__list li:first-child",this.container).length&&this.assignEventListeners();var n=e.$(".weather-location__current",this.container).attr("data-weather");e.pubsub.emit("weather:locationChanged",[{id:n}])},assignEventListeners:function(){this.locations=e.$(this.container),this.list=e.$(".weather-location__list",this.container),this.listItems=e.$("li",this.container),this.button=e.$(".weather-location__show-locations",this.container);var n=this;n.button[0].addEventListener("click",function(){n.list.hasClass("hidden")?n.button.text("Hide locations"):n.button.text("Show locations"),n.button.toggleClass("weather-location__show-locations--open"),n.list.toggleClass("hidden")},!0);var o=function(o){var i=o||window.event;if("keypress"!==o.type||"keypress"===o.type&&13===i.keyCode){var s=i.target||i.srcElement,a=e.$(s),r={},c=document.getElementById("comp-weather");n.clicked=a.text(),n.listItems.removeClass("hidden"),a.addClass("hidden"),e.$(".weather-location__current",this.locations).text(n.clicked),n.button.removeClass("weather-location__show-locations--open"),n.list.addClass("hidden"),r.id=o.target.getAttribute("data-weather"),e.pubsub.emit("weather:locationChanged",[r]),n.elementInView(n.button)||"desktop"===t.getType()||c.scrollIntoView()}};e.$("li",n.list).each(function(){this.addEventListener("click",function(e){o(e)},!0)}),n.list[0].addEventListener("keypress",function(e){o(e)},!0)},elementInView:function(t){return t.offset().top>e.$(window).scrollTop()},handleSuccess:function(e){this.insertWeatherLocationDropdown(e),this.showWeatherLocation()},handleError:function(){this.hideWeatherLocation()},showWeatherLocation:function(){this.container.removeClass("hidden")},hideWeatherLocation:function(){this.container.addClass("hidden")}},n});try{define("module/localnewsandweather",["module/bootstrap","module/locatorFacade","module/local/local","module/local/localView","module/weather/weather","module/weather/weatherView","config","translator","module/weather/weatherLocation","module/weather/weatherLocationView"],function(e,t,n,o,i,s,a,r,c,l){var u={LOCATOR:".locator",WEATHER:".weather-forecast",LOCAL:".locator-stories-placeholder"};return{init:function(t){if(this.moduleElement=e.$(t),this.moduleElement.length){this.moduleTitle=e.$(".local-weather__title",this.moduleElement),this.locatorElement=e.$(".locator",this.moduleElement),this.localNewsElement=e.$(".locator-stories-placeholder",this.moduleElement),this.titleLink=e.$("a",this.moduleTitle);var r=e.$(".weather-dropdown",this.moduleElement);r.length&&(this.weatherLocation=new c,this.weatherLocationView=new l(r),e.pubsub.on("weather:locationChanged",e.$.proxy(this.setTitleLink,this))),this.local=new n({simple:!(!a.local||!a.local.simple)&&a.local.simple,story_limit:a.local&&a.local.story_limit?a.local.story_limit:2,append_ext:a.local&&a.local.append_ext?a.local.append_ext:void 0}),this.type="average",a.local&&a.local.weather_type&&(this.type=a.local.weather_type),this.weather=new i({type:this.type,append_ext:a.local&&a.local.append_ext?a.local.append_ext:void 0}),this.localView=new o(u.LOCAL,this.moduleElement),this.weatherView=new s(u.WEATHER),this.locatorElement.length&&this.renderLocator(),this.localNewsElement.length&&this.renderLocal(),this.renderWeather(),this.show()}},setTitle:function(e,t){t&&(e='{{title}}'.replace("{{link}}",t).replace("{{title}}",e)),this.moduleTitle.html(e)},setTitleLink:function(e){this.weatherBaseUrl||(this.weatherBaseUrl=this.titleLink[0].href),e.id&&"string"==typeof e.id&&this.titleLink.attr("href",this.weatherBaseUrl+"/"+e.id.toString().toLowerCase())},renderLocator:function(){t.open(u.LOCATOR),this.location=t.getLocation(),this.location||(this.setTitle(r.get("localNewsAndWeather")),e.pubsub.emit("locator:renderForm"))},renderLocal:function(){this.local.updateLocalNews(this.location)},renderWeather:function(){this.weather.updateWeather(this.location)},show:function(){this.moduleElement.removeClass("hidden")},hide:function(){this.moduleElement.addClass("hidden")}}})}catch(e){}define("module/components/weatherAdaptor",["module/localnewsandweather"],function(e){e.init("#comp-weather")}),define("module/comscoreAdapter",["config","module/stats/comscore"],function(e,t){new t(e).sendPageViewBeacon()}),define("vendor/bbc-video-experience/bbcdotcom/adverts",[],function(){var e,t,n=function(){return void 0!==window.bbcdotcom&&!0===window.bbcdotcom.config.isAdsEnabled()};return{init:function(t){e=void 0!==t.assetType?t.assetType:""},initBump:function(e){t=e},isAdsModuleEnabled:n,updateAdTag:function(o){if(t&&n()){var i;try{i=window.bbcdotcom.av.emp.adverts.getPrerollAdTagWithAdRule()}catch(e){return}if(o&&o.shortHeadline&&o.uri&&o.assetId){for(var s=encodeURIComponent(o.shortHeadline.toLowerCase().split(" ").join("")),a=o.assetId,r=encodeURIComponent(encodeURIComponent(window.location.origin+o.uri)),c=14,l="";c--;)l+=Math.floor(10*Math.random());i=i.replace(/(correlator=)(\d+)/g,"correlator="+l),i=i.replace(/(url=)[^&]*/g,"url="+r),""!==e&&(i=i.replace(/(asset_type%3D(media_asset|index))/g,"asset_type%3D"+e)),i=i.replace(/(headline%3D)\w+/g,"headline%3D"+s),i=i.replace(/(story_id%3D)\w+/g,"story_id%3D"+a),t.dispatchEvent("bbc.smp.plugins.ads.event.updateAdTag",{adTag:i})}}},initCompanionAds:function(){if(n()){var e=document.getElementById("bbccom_mpu"),t='';e.innerHTML=t;var o=bbcdotcom.adverts.adUnit.get();googletag.cmd.push(function(){googletag.defineSlot(o,[300,60],"bbccom_mpu_inner").addService(googletag.companionAds()).addService(googletag.pubads()),googletag.enableServices()})}}}}),define("vendor/bbc-video-experience/analytics/adapter",[],function(){var e={},t={},n=function(e){t[e.getName()]=e},o=function(n){var o=n.getProviderName();if(t[o]){var i=n.getEvents(),s=n.getBuilders();for(var a in i){void 0===e[a]&&(e[a]=[]);var r={providerName:o,eventName:i[a],builder:s[a]};void 0!==r.builder&&e[a].push(r)}}},i=function(){for(var n=arguments[0],o=[],i=1;io?"portrait":"landscape")&&(this.imagesToResize[n].parentElement.className+=" portrait-margins"),this.imagesToResize[n].style.paddingBottom=i/o*100+"%"}}}}),define("module/galleryAdapter",["module/gallery"],function(e){e.init()}),define("module/gazzetta",["module/bootstrap","module/tabbed/tabbed"],function(e,t){return{init:function(){var n=e.$,o=n("#tracker-tab li"),i=n(".tracker-container"),s=o[0]?new t(o,i):null;"started"===n("#tracker-tab").attr("data-knockout-status")&&s.tabs[1].activate(),n(".knockout__title").on("click",function(e){n(this).parent().toggleClass("knockout--closed")}),n(".live-scores__refresh").on("click",function(e){e.preventDefault();var t=n(this),o=t.closest(".live-scores").attr("id");return window.location.href=t.attr("href")+"#"+o,window.location.reload(),!1})}}}),define("module/gazzettaAdapter",["module/bootstrap","module/gazzetta"],function(e,t){e.$(".live-scores").length&&t.init()}),define("module/hotspot/handlerAdapter",["module/hotspot/handler"],function(e){e.init()}),define("module/hotspot/handlerPostLoad",["module/hotspot/handler"],function(e){return{reProcess:e.init}}),define("module/iconLoaderAdapter",["module/iconLoader"],function(e){e.init()}),define("module/index",["module/bootstrap","module/imageenhancer","module/timestamp","module/history/history","module/localnewsandweather","module/sport/sportView","module/gazzetta","config"],function(e,t,n,o,i,s,a,r){var c=e.$;return{init:function(){var e=(new n(new Date((new Date).toUTCString()).getTime()),c("#travel"),new s);new t,r.features.localnews&&r.locatorFlagPole&&require(["module/localnewsandweather"],function(e){e.init("#comp-weather")}),c("#comp-sport-stories").length>0&&e.init(c("#comp-sport-stories")),c(".live-scores").length&&a.init()}}}),define("module/indexTitleAdaptor",["module/indexTitle"],function(e){e.init()}),define("module/live-event-component",["config","module/bootstrap","module/poller","module/timestamp"],function(e,t,n,o){return{pollingUrl:function(e,t,n){return void 0===t&&(t={service:"nfp"}),e+"/"+t.service+"/walkietalkie/latest_index_asset/"+n},handleSuccess:function(){e.features.liveeventcomponent&&this.init(e.pollingHost,null)},init:function(i,s){var a=t.$,r=this;a("[data-channel]").each(function(){var t=a(".article-inner",this),c=a(".live-event-summary",t),l=a(".live-event-entries",t),u=a(this).attr("data-channel"),d=new n(30),h="",p=r.pollingUrl(i,e,u);d.startCacheBusting(),d.setUrl(p),d.startPolling({success:function(e){if(a.trim(l.html())||c.remove(),e.entryId!==h){var t=null;if(e.createTime){var n=e.createTime.split(/[\-T:]/g),i=new Date(n[0],n[1]-1,n[2]);i.setHours(n[3],n[4],n[5]);var r=((new Date).getTime()-i.getTime())/1e3,u=new o(null),d=u.timeAgoInWords(r);d&&(t='")}if(t){var m=e.html.indexOf(">")+1,f=e.html.substring(0,m),g=e.html.substring(m);e.html=f+t+g}return s?s(l,e.html):(l.css("opacity","0"),setTimeout(function(){l.html(e.html).css("opacity","1")},1200)),h=e.entryId,p}},error:function(){a.trim(l.html())||(l.css("display","none"),c.css("visibility","visible"),d.stopPolling())}})})}}}),define("module/local/localSwift",["module/bootstrap","module/components/swift/collection"],function(e,t){return{init:function(){e.pubsub.on("local:handleLoaded",t.cleanup),e.pubsub.on("local:newsRendered",t.init)}}}),define("module/local/localSwiftAdapter",["module/local/localSwift"],function(e){e.init()}),define("module/localisation/scriptToggleAdapter",["module/localisation/scriptToggle"],function(e){e.init()}),define("module/locator",["config","module/bootstrap","vendor/locator/main"],function(e,t,n){return new n({pubsub:t.pubsub,enableReverseGeocode:!(!e.local||!e.local.allowLocationLookup)&&e.local.allowLocationLookup,enableAutoComplete:!(!e.local||!e.local.allowAutoComplete)&&e.local.allowAutoComplete,host:e.locatorHost,confirmLocationSelection:!0,persistLocation:!0})}),define("module/mediaAssetPage/api",["module/bootstrap","module/featureDetector"],function(e,t){var n=function(){var t=this;e.pubsub.on("map:asset:load",function(e){t.request(e,"asset")}),e.pubsub.on("map:feed:load",function(e){t.request(e,"feed")})};return n.prototype={request:function(t,n,o){var i=e.config.pathPrefix;e.pubsub.emit("map:request:start",[t,n]),e.$.ajax({url:i+"/api/av/"+n+"/"+t+".html",type:"get",dataType:"json",success:function(i){i.feed&&(i=i.feed),o&&o(i),e.pubsub.emit("map:"+n+":request:success",[t,i])},error:function(o){e.pubsub.emit("map:"+n+":request:error",[t,o])}})}},n}),define("module/page",["istats-1"],function(e){return{getCountername:function(){return e.getCountername()},setCountername:function(t){e.setCountername(t)}}}),define("module/mediaAssetPage/assetView",["module/bootstrap","module/timestamp","translator","config","deviceInspector","module/page"],function(e,t,n,o,i,s){function a(){g=new t(new Date((new Date).toUTCString()).getTime()),e.pubsub.on("map:asset:request:success",d),e.pubsub.on("map:asset:request:error",p),e.pubsub.on("map:asset:load",function(){v("#media-asset-page-video figure").remove()}),u()}function r(e){v(".story-inner .more-wrapper").css("display","block"),v(".story-inner .more-text").text(n.get("moreInfo"));var t=v(".map-body",e),o=1;t.children().first().is("figure")&&o++,e.addClass("contains-more-text"),t.append('
    ');var i=v(".hide-wrapper",e);v(".map-body > *",e).each(function(){0!==o||v(this).hasClass("hide-wrapper")?--o:i.append(this)}),t.removeClass("display-feature-phone-only")}function c(){var t=v(".story-inner"),o=v("#media-asset-page-text",t),i=(v(".map-body",o),'");o.after(i),v(".more-text",t).on("click",function(t){var i=t.target,s=v(".hide-wrapper",o);s.toggleClass("extra-content"),s.hasClass("extra-content")?(e.pubsub.emit("map:asset:summary",["close"]),i.innerHTML=n.get("moreInfo")):(e.pubsub.emit("map:asset:summary",["open"]),i.innerHTML=n.get("lessInfo")),t.preventDefault()})}function l(t){"desktop"===t||m()||(e.pubsub.off("device",l),c(),r(v(".story-inner #media-asset-page-text")))}function u(){var t=v(".story-inner"),n=v("#media-asset-page-text",t),o=v(".more-text",t),s=v(".map-body > *",n).length;s<=1||2===s&&v(".map-body .related-items",n).length>0||"desktop"===i.getType()||m()?(v(".map-body",n).removeClass("display-feature-phone-only"),o.css("display","none"),n.removeClass("contains-more-text"),e.pubsub.on("deviceGroup",l)):(0===v(".more-text",t).length&&c(),r(n))}function d(e,t){h(t.countername);v("#media-asset-page-text");v("#media-asset-page-text").html(t.body),g.insertTime(),u(),f(t.related),window.scrollTo(0,1)}function h(e){s.setCountername(e)}function p(e,t,n){}function m(){var e=!1;return o.features2.hasOwnProperty("channel_page")&&(e=o.asset.asset_uri===o.pathPrefix+"/"+o.features2.channel_page.candy_id),e}function f(e){e.match("media-feed-error")?(v(".media-feed.primary-feed.related-video-audio").addClass("hidden"),v("#media-asset-list-view__tab-1").addClass("hidden off-screen")):(v(".media-feed.primary-feed.related-video-audio").removeClass("hidden"),v("#media-asset-list-view__tab-1").removeClass("hidden off-screen"))}var g,v=e.$;return{init:a}}),define("module/mediaUtils/timeInterval",[],function(){function e(e){if(!i[e]){var t=e.match(/PT((\d+)H)?((\d+)M)?((\d+)S)?/);if(null===t)throw"Could not parse time interval: "+e;var n=void 0!==t[2]?parseInt(t[2],10):0,o=void 0!==t[4]?parseInt(t[4],10):0,s=void 0!==t[6]?parseInt(t[6],10):0;i[e]={h:n,m:o,s:s}}return i[e]}function t(e){return e.toString().replace(/^(\d)$/,"0$1")}function n(n){var o=e(n);return o.m+":"+t(o.s)}function o(t){var n=e(t);return 3600*n.h+60*n.m+n.s}var i={};return{toTimestamp:n,toSeconds:o}}),define("module/mediaUtils/playlistObjectBuilder",["module/mediaUtils/timeInterval","module/featureDetector"],function(e,t){function n(e,t){var n=[];return o(t,e)&&n.push(r),n.push({vpid:e.externalId,live:e.live,kind:s(e)}),{embedRights:e.allowOffSiteEmbedding?"allowed":"blocked",guidance:e.guidance,holdingImageURL:e.image&&e.image.href?e.image.href:"",items:n,title:e.caption,simulcast:e.live}}function o(t,n){return i()&&"radioProgramme"!==s(n)&&t.editorAdFlag&&e.toSeconds(n.duration)>30}function i(){return t.is("DisplayingGnlAds")}function s(e){if(void 0!==e.kind)return e.kind;for(var t in e.id){var n=e.id[t],o=a[n];if(void 0!==o)return o}return""}var a={audios:"radioProgramme",videos:"programme"},r={kind:"advert",media:{kind:"video",type:"video/mp4"}};return{build:n}}),define("module/mediaAssetPage/continuousPlay/dataProvider",["module/bootstrap","module/mediaUtils/playlistObjectBuilder","module/mediaUtils/timeInterval"],function(e,t,n){"use strict";var o,i,s=e.$,a=function(e){i=(e||{}).endpoint},r=function(e){s.ajax({url:i,dataType:"jsonp",jsonpCallback:"cpItems",crossDomain:!0}).done(function(t){o=t;var n=s(".related-video-audio article").toArray();if(n.unshift(s(".media-asset").get(0)),o.length!==n.length)return void e("Number of related videos do not match");e(null,n)}).fail(function(t){e(t.statusText)})},c=function(e,i){var a=i[e],r=s(a),c=o[e],l=c.media,u={};return"0"===e?(u.title=r.find(".story-body__h1").text(),u.date=r.find(".date--v1 strong").text(),u.uri=r.find(".story-body__h1").data("asset-uri")):(u.title=r.find(".cta").text(),u.date=r.find(".date--v1").data("datetime"),u.uri=r.data("uri")),u.imgUrl=l.image?l.image.href:null,u.duration=l.duration?n.toTimestamp(l.duration):null,u.counterName=l.istatsCounterName?l.istatsCounterName:null,u.playlist=t.build(c.media,c.advert),u},l=function(e){var t;if(e&&e.split&&!(e.indexOf("/")<0))return t=e.split?e.split("/"):[],"/"+t.splice(1,1)+"/api/av/asset"+t.join("/")},u=function(e,t){var n=l(e);n&&s.ajax({url:n,dataType:"jsonp",jsonpCallback:"cpAsset",crossDomain:!0}).done(function(e){t(null,e)}).fail(function(e){t(e.statusText)})};return{init:a,findItems:r,parseItem:c,parseAdvertMeta:function(e){return o[e].advert},getMediaAsset:u,getMetaData:function(e){return o[e]}}}),define("module/mediaAssetPage/continuousPlay/view",["module/bootstrap"],function(e){"use strict";var t,n=e.$,o=function(){t=n(".related-video-audio article").toArray(),t.unshift(n(".media-asset").first())},i=function(e){var o=n(t[e]),i=n(t[e+1]),s=!0;u("next"),e<1&&(s=!1),s&&(u("selected"),e>0&&l(o,"selected","NOW PLAYING")),i.length>0&&l(i,"next","UP NEXT")},s=function(e){n("#media-asset-page-text").empty().append(e.removeClass("display-feature-phone-only")).show()},a=function(e){n(".share-wrapper").empty().append(e).show()},r=function(){n(".share-wrapper").hide()},c=function(e){var t=n("#media-asset-page-text h1");t.data("asset-uri","").text(e),n("#media-asset-page-text").empty().append(t)},l=function(e,t,o){e.addClass(t),n("."+t).find(".js-media-duration").text(o)},u=function(e){n(".media-feed-item."+e).each(function(t,o){var i=n(o);i.removeClass(e),n(".js-media-duration",i).text(i.attr("data-duration"))})};return{init:o,updateTags:i,updatePageContent:s,updateShareTools:a,removeNextTag:function(){u("next")},hideShareTools:r,hidePageContent:c,getMediaAssetUri:function(){return n(".media-asset").first().find(".story-body__h1").data("asset-uri")}}}),define("module/mediaAssetPage/continuousPlay/handler",["module/bootstrap","module/continuousPlay","module/mediaAssetPage/continuousPlay/dataProvider","module/mediaAssetPage/continuousPlay/view","module/page"],function(e,t,n,o,i){"use strict";var s,a=function(e){var t=n.getMetaData(e)||{},s=o.getMediaAssetUri();o.updateTags(e),t.media&&t.media.istatsCounterName?i.setCountername(t.media.istatsCounterName):(i.setCountername(null),i.setCountername(i.getCountername())),t.advert&&t.advert.uri!==s&&n.getMediaAsset(t.advert.uri,function(e,n){var i=void 0!==t.advert.shortHeadline?t.advert.shortHeadline:"";e?(o.hidePageContent(i),o.hideShareTools()):(n.body?o.updatePageContent($(n.body)):o.hidePageContent(i),n.shareTools?o.updateShareTools($(n.shareTools)):o.hideShareTools())})},r=function(){o.removeNextTag()},c=function(){e.pubsub.on("continuousPlay:videoPlayed",function(e){a(e)}),e.pubsub.on("continuousPlay:dismissed",function(){r()})};return{init:function(e){s=e||{},s.advertAssetType="media_cplay",c(),n.init(s.dataProvider),o.init(),t.init(n,s)}}}),define("module/mediaAssetPage/listView",["module/bootstrap","module/featureDetector","module/tabbed/tabbed","module/timestamp","translator","config"],function(e,t,n,o,i,s){function a(e,t,n){!1===n(t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}function r(t,n){document.title=n,e.pubsub.emit("map:asset:load",[t.replace(s.pathPrefix+"/","")])}function c(n){v(),T=n, S=new o(new Date((new Date).toUTCString()).getTime()),e.pubsub.on("map:feed:request:success",b),e.pubsub.on("map:feed:request:error",y),e.pubsub.on("map:asset:request:success",_),e.pubsub.on("tabs:activate",m),t.can("UseHistoryApi")&&window.addEventListener("popstate",function(e){null!==e.state&&e.state.title&&e.state.path&&(-1===e.state.path.indexOf("/news/video_and_audio/")?r(e.state.path,e.state.title):window.history.go(0))});var i=P(".top_stories.showmore.open .media-feed-placeholder .media-feed-grid");0!==i.length&&i.append(u(C())),l(),f(),w()}function l(){var e=P(".media-feeds")[0];e&&(e.onclick=function(t){for(var n=t||window.event,o=n.target||n.srcElement;o!==e;){if(("ARTICLE"===o.nodeName||"DIV"===o.nodeName&&-1!==o.className.indexOf("HTML5article"))&&P(o).hasClass("media-feed-item")){a(n,o,d);break}if("H2"===o.nodeName&&0!==P("a",o).length){a(n,o,p);break}if(P(o).hasClass("more-text")){a(n,o,g);break}o=o.parentNode}})}function u(e){return'"}function d(e){if(P(e).hasClass("selected"))return!1;null!==e.attributes["data-uri"]&&(window.location.href=e.attributes["data-uri"].value+window.location.search)}function h(e){return P('.media-feed[data-cps-id="'+e+'"]')}function p(t){var n=t.parentNode.attributes["data-cps-id"].value.replace(s.pathPrefix+"/",""),o=h(n),i=P(".media-feed-grid",o);o.toggleClass("open");var a=o.hasClass("open")?"open":"close",r=o.attr("data-event");if(e.pubsub.emit("map:index:toggle",[r,a]),0===i.length&&o.hasClass("open")){var c=P(".media-feed-error",o);0!==c.length&&c.remove(),o.addClass("loading-after"),e.pubsub.emit("map:feed:load",[n])}return!1}function m(t,n){var o=P(x.tabs[n].t).attr("data-cps-id");if(o){var i=h(o),s=P(".media-feed-grid",i);i.addClass("open"),0===s.length&&(i.addClass("loading-after"),e.pubsub.emit("map:feed:load",[o]))}}function f(){var e;P(".media-panel").each(function(t,n){P(n).hasClass("open")&&(e=t)}),x=new n(P("#media-tabs li"),P(".media-panel"),!0,"media-asset-list-view"),!1===s.features2.map_most_watched&&(e=0),e&&(x.tabs[e].activate(),m("default",e))}function g(t){var n=t,o=h(n.getAttribute("data-cps-id"));return o.toggleClass("showmore"),o.hasClass("showmore")?(e.pubsub.emit("map:index:topstories",["close"]),n.innerHTML=i.get("showMore")):(e.pubsub.emit("map:index:topstories",["open"]),n.innerHTML=i.get("showLess")),!1}function v(){var e=P(".media-feed.top_stories"),t=P("h2",e);P("a",e).replaceWith(function(){return this.innerHTML}),t.text(P.trim(t.text())),e.addClass("primary-feed")}function b(e,t){var n=h(e),o=P(".media-feed-placeholder",n);if(t&&o.html(t),S.insertTime(),n.hasClass("showmore")){P(".media-feed-grid",o).append(u(e))}n.removeClass("loading-after"),k()}function y(e,t){var n=h(e);n.removeClass("loading-after"),0===P(".media-feed-error",n).length&&n.append('
    '+i.get("mediaUnavailable")+"
    ")}function w(){P(".media-feed.js-postload").each(function(t,n){var o=P(n).attr("data-cps-id");null!==o&&0===P(".media-feed-item",n).length&&(P(n).addClass("loading-after"),e.pubsub.emit("map:feed:load",[o]))})}function _(e,t){k(e);var n=P(".related-video-audio .media-feed-grid"),o=P(".related-video-audio .media-feed-error");if(1===n.length){n.replaceWith(t.related);var i=0;P("#media-asset-list-view__tab-1").hasClass("hidden off-screen")&&(i=1),x.tabs[i].activate()}1===o.length&&o.replaceWith(t.related)}function k(e){e&&(T=s.pathPrefix+"/"+e),P(".media-feed-item.selected").each(function(e,t){var n=P(t);n.removeClass("selected"),P(".js-media-duration",n).text(n.attr("data-duration"))}),P('.media-feed-item[data-uri="'+T+'"]').each(function(e,t){var n=P(t);n.addClass("selected"),P(".js-media-duration",n).text(i.get("nowPlaying"))})}function C(){return s.configuration.hasOwnProperty("videotopiccandyid")&&s.configuration.videotopiccandyid?s.configuration.videotopiccandyid:"video_and_audio/top_stories"}var x,S,T,P=e.$;return{init:c,modifyTopStoriesHeader:v}}),define("module/mediaAssetPage/map",["module/bootstrap"],function(e){return{init:function(){var t=this;e.pubsub.on("map:asset:request:success",function(e,n){t.updateShareTools(n.shareTools)})},updateShareTools:function(t){e.$(".share").replaceWith(t)}}}),define("module/mediaAssetPage/mediaAssetPage",["module/assortedUtils","module/bootstrap","module/transclude","module/mediaAssetPage/assetView","module/mediaAssetPage/listView","module/mediaAssetPage/api","module/mediaAssetPage/map","module/mediaAssetPage/continuousPlay/handler","module/components/mediaPlayer/autoPlay","module/components/mediaPlayer/view"],function(e,t,n,o,i,s,a,r,c,l){function u(){var e=document.getElementById("page");if(e)return e.getAttribute("data-map-id")}function d(){var e,t=l.getPlayableForPlaceholder(l.findFirstMediaPlaceholder());return e=t.otherSettings.continuousPlayCfg,e.autoPlayFirstItem=c.isEnabled(t),e}new s,e.jsonParse;!function(){o.init();var e=u(),s=d();if(r.init(s),i.init(e),a.init(),t.config.features2.map_most_watched){(new n).get(".media-tab.most-watched a",{target:".most-watched .media-feed-placeholder",success:function(){t.pubsub.emit("map:feed:request:success",["most-watched"])},error:function(){t.pubsub.emit("map:feed:request:error",["most-watched"])},insert:!0})}else t.pubsub.emit("map:feed:request:error",["most-watched"])}()}),define("module/nav/nav",["module/bootstrap"],function(e){var t=e.$,n=function(e,t){this.button=e,this.nav=t,this.state=!1,this.name=this.button&&this.button.attr?this.button.attr("data-event"):"",this.setupBindings(),this.setupListeners()};return n.prototype={getName:function(){return this.name},setupListeners:function(){e.pubsub.on("nav:all:close",t.proxy(this.close,this)),e.pubsub.on(this.getEventName("close"),t.proxy(this.close,this)),e.pubsub.on("nav:all:open",t.proxy(this.open,this)),e.pubsub.on(this.getEventName("open"),t.proxy(this.open,this)),e.pubsub.on("tabs:click",t.proxy(this.close,this))},setupBindings:function(){this.button.on("click",t.proxy(function(t){t.preventDefault(),this.state?e.pubsub.emit(this.getEventName("close"),"close"):e.pubsub.emit(this.getEventName("open"),"open")},this)),this.nav.on("click",t.proxy(function(t){e.pubsub.emit(this.getEventName("close"),"close")},this))},close:function(){this.state=!1,t(".site-brand").removeClass(this.getOpenClass()),t("#js-navigation-sections-wrapper").removeClass(this.getOpenClass()),t(".navigation--footer").removeClass(this.getOpenClass())},open:function(){e.pubsub.emit("nav:all:close","close"),this.state=!0,t(".navigation--footer").hasClass(this.getOpenClass())||"footer"!==this.getName()?(t("#js-navigation-sections-wrapper").addClass(this.getOpenClass()),t(".site-brand").addClass(this.getOpenClass())):t(".navigation--footer").addClass(this.getOpenClass())},getOpenClass:function(){return"navigation__"+this.getName()+"--open"},getEventName:function(e){return"nav:"+this.getName()+":"+e}},n}),define("module/nav/navManager",["module/bootstrap","module/nav/nav","translator","config"],function(e,t,n,o){var i=e.$;return{init:function(){var e=i("#js-navigation-cta-header"),t=i("");i.each(e.prop("attributes"),function(){"href"!==this.name&&t.attr(this.name,this.value)}),e.replaceWith(t),this.bottomNav=i("#js-navigation-sections").removeAttr("role").removeAttr("aria-label"),this.topButton=i("#js-navigation-cta-header"),this.topNavPlaceholder=i(".navigation--open .navigation__panel"),this.createFooterButton(n.get("section")),this.cloneNavToHead(),this.createNavs()},createFooterButton:function(e){var t=o.service.charAt(0).toUpperCase()+o.service.slice(1);this.bottomNav.before('"),this.bottomButton=i(".navigation__cta-footer")},cloneNavToHead:function(){var e=this.bottomNav[0].cloneNode(!0);e.id="js-navigation-sections-header",this.bottomNav.addClass("footer").attr("id","js-navigation-sections-footer"),this.topNavPlaceholder.append(e),this.topNav=i(e)},createNavs:function(){new t(this.topButton,this.topNav),new t(this.bottomButton,this.bottomNav)}}}),define("module/navigation/handlerAdaptor",["module/navigation/handler"],function(e){e.init()}),define("module/touchEvents",["module/bootstrap","module/featureDetector"],function(e,t){var n=e.$;return{touchStart:function(e){this.startX=e.originalEvent.targetTouches[0].clientX,this.fastFlick=!0,setTimeout(n.proxy(function(){this.fastFlick=!1},this),this.flickTime)},touchMove:function(t){this.endX=t.originalEvent.targetTouches[0].clientX,this.transformFunction(this.endX-this.startX),e.pubsub.emit("touch:move"),this.enableTouchMove=!0},isSwipeOrFlick:function(e){return Math.abs(e)>this.flickDistance&&this.fastFlick||Math.abs(e)>this.swipeDistance},handleTouchMove:function(){var e=this.endX-this.startX;this.slidingElementContainer.addClass("snap-position"),this.isSwipeOrFlick(e)?(this.swipe=!0,e>0?(this.transformFunction(this.snapInterval),this.swipeDirection="right"):(this.transformFunction(-this.snapInterval),this.swipeDirection="left")):this.transformFunction(0)},touchEnd:function(){this.enableTouchMove&&this.handleTouchMove(),this.enableTouchMove=!1},setSnapInterval:function(e){this.snapInterval=window.document.documentElement.clientWidth*(1+e)},swipeEnd:function(){e.pubsub.emit("touchmove:"+this.swipeDirection),this.transformFunction(0),this.swipe=!1},transitionEnd:function(){this.slidingElementContainer.removeClass("snap-position"),this.swipe&&this.swipeEnd(),e.pubsub.emit("touch:end")},handleResize:function(){this.setSwipeDistance(),this.setSnapInterval(this.spaceBetweenItemsRatio)},bindEvents:function(){this.container.on("touchstart",n.proxy(function(e){this.touchStart(e)},this)),this.container.on("touchmove",n.proxy(function(e){e.preventDefault(),this.touchMove(e)},this)),this.container.on("touchend",n.proxy(function(){this.touchEnd()},this)),n(window).on("resize",n.proxy(function(e){this.handleResize()},this)),this.slidingElementContainer.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",n.proxy(function(){this.transitionEnd()},this))},setSwipeDistance:function(){this.swipeDistance=window.document.documentElement.clientWidth*this.swipeDistanceRatio},transform3d:function(e){this.slidingElementContainer.css("transform","translate3d("+e+"px,0,0)")},transform:function(e){this.slidingElementContainer.css("transform","translateX("+e+"px)")},positionLeft:function(e){this.slidingElementContainer.css("left",e)},setTransformFunction:function(){return this.canTransform3d=!1,t.can("CssTransform3d")?(this.canTransform3d=!0,this.transform3d):t.can("CssTransform")?this.transform:(n("body").addClass("no-translate"),this.positionLeft)},config:function(e){this.container=n(e.touchEventContainer),this.slidingElementContainer=n(e.slidingElementContainer),this.swipeDistanceRatio=.5,this.flickDistance=30,this.flickTime=250,this.setSwipeDistance(),this.spaceBetweenItemsRatio=e.spaceBetweenItemsRatio,this.setSnapInterval(this.spaceBetweenItemsRatio)},handleTouchEventsSupport:function(e){this.config(e),this.transformFunction=this.setTransformFunction(),this.canTransform3d&&this.transform3d(0),this.enableTouchMove=!1,this.bindEvents(),n("html").addClass("swipe-on")},init:function(e){t.can("TouchEvents")&&this.handleTouchEventsSupport(e)}}}),define("module/pictureViewer",["module/bootstrap","module/featureDetector","vendor/lo-dash/lo-dash","module/touchEvents","module/urlShrinker"],function(e,t,n,o,i){var s,a,r=e.$,c={global:null,body:r(".direction"),request:function(t,n){r.ajax({url:e.config.pathPrefix+"/api/pictures/"+t,type:"get",dataType:"json",success:function(t){n&&n(),e.pubsub.emit("pictureViewer:loaded",[t])}}),this.pictureViewerRequested=!0},loadViewer:function(e){this.body.append(e.body),o.init({touchEventContainer:"#picture-viewer",slidingElementContainer:".picture-viewer__pictures",spaceBetweenItemsRatio:.2}),this.pictureViewer=r("#picture-viewer"),this.pictureContainer=r(".picture-viewer__pictures")},setHeightToFillScreen:function(){r(".image-container").height(this.browserHeight)},setImageHeight:function(e,t){e.element.css({height:t})},setImageMaxWidth:function(e,t){e.element.css({"max-width":t+"px"})},getWindowMeasurements:function(){var e=this.doc.documentElement;this.browserHeight=e.clientHeight,this.browserWidth=e.clientWidth,this.browserRatio=this.browserWidth/this.browserHeight},calculateDimensions:function(e){var t=e.height,n=e.width,o=e.ratio,i=1/o,s={};return e.element.attr("style",""),n>this.browserWidth&&t>this.browserHeight?o>this.browserRatio?(s.maxWidth=this.browserWidth,s.height=i*this.browserWidth):(s.height=this.browserHeight,s.maxWidth=o*this.browserHeight):n>this.browserWidth?s.height=i*this.browserWidth:t>this.browserHeight?(s.maxWidth=o*this.browserHeight,s.height=this.browserHeight):(s.maxWidth=n,s.height=t),s},handleImageCalculations:function(){s(),this.setImageDimensions(this.image,this.calculateDimensions(this.image)),a()},setImageDimensions:function(e,t){t.maxWidth&&this.setImageMaxWidth(e,t.maxWidth),t.height&&this.setImageHeight(e,t.height)},replaceDivWithImage:function(e,t){var n=e.element;n.hasClass("image--placeholder")&&(n.replaceWith(''),e.element=r(".image").eq(t))},calculateImageData:function(){this.images=r(".image").map(function(){var e=r(this),t=e.attr("data-width"),n=e.attr("data-height");return{element:e,width:t,height:n,ratio:t/n}}),this.numberOfImages=this.images.length,this.imageContainers=r(".picture")},toggleViewerVisibility:function(e){this.pictureViewer&&this.pictureViewer.length?this.pictureViewer.toggleClass("hidden"):(this.loadViewer(e),this.calculateImageData(),this.getWindowMeasurements(),this.setHeightToFillScreen())},handleResize:function(){this.getWindowMeasurements(),this.setHeightToFillScreen(),this.handleImageCalculations()},toggleViewerEvent:function(){var t=r("html"),n="picture-viewer-enable";t.hasClass(n)?(t.removeClass(n),r(this.global).off("resize",r.proxy(this.handleResize,this)),e.pubsub.emit("pictureViewer:close")):(t.addClass(n),r(this.global).on("resize",r.proxy(this.handleResize,this)),e.pubsub.emit("pictureViewer:open"))},toggleViewer:function(e){this.toggleViewerVisibility(e),this.toggleViewerEvent(),this.changeImage(),this.updatePaginationText()},handlePictureInteraction:function(){var e=r("#js-photos").attr("data-asset-id");this.pictureViewerRequested?this.toggleViewer(""):this.request(e)},createGalleryHeadline:function(e){this.pictureViewer.find(".picture__information").prepend('

    '+this.galleryHeadline+"

    ")},toggleCaptionButtonText:function(){r(".picture-viewer__button--captions").find("span").toggleClass("show")},getPrevPictureNumber:function(){var e=this.numberOfImages;return 0!==this.currentPictureNumber&&(e=this.currentPictureNumber),e-1},getNextPictureNumber:function(){var e=this.currentPictureNumber+1;return this.currentPictureNumber===this.numberOfImages-1&&(e=0),e},paginate:function(e){var t="getNextPictureNumber";"left"===e&&(t="getPrevPictureNumber"),this.currentPictureNumber=this[t](),this.setHash(this.currentPictureNumber+1)},updatePaginationText:function(){r(".picture__picture-no").text(this.currentPictureNumber+1),r(".picture__picture-total").text(this.numberOfImages)},handleStats:function(t){var n=[];t.visibility&&n.push(t.visibility),r("#asset-type-pgl").length&&(n.push(-1!==t.targetClass.indexOf(t.selector)?t.position:t.defaultPosition),e.pubsub.emit(t.pubsubEvent,n))},statsBackButton:function(e){this.handleStats({position:"top",selector:"picture-viewer__button--back",defaultPosition:"bottom",pubsubEvent:"gallery:viewer:toggle",targetClass:e.target.className})},statsShowImageOnlyButton:function(){var t=this.pictureViewer.hasClass("show-image-only")?"on":"off";e.pubsub.emit("gallery:imageonly:toggle",[t])},statsCaptionButton:function(){var t=this.pictureViewer.hasClass("hide-captions")?"off":"on";e.pubsub.emit("gallery:caption:toggle",[t])},statsNavigation:function(e){this.handleStats({position:"left",selector:"picture-viewer__pagination--left",defaultPosition:"right",visibility:t.is("TouchDevice")?"off":"on",pubsubEvent:"gallery:paginate:click",targetClass:e&&e.target?e.target.className:""})},processPictureViewer:function(e,t){this.galleryHeadline=t,this.currentPictureNumber=e-1,this.handlePictureInteraction()},handlePaginateEvent:function(e,t){this.enableHiddenButtons&&(this.paginate(t),this.changeImage(),this.updatePaginationText(),this.statsNavigation(e)),this.enableHiddenButtons=!0},handleRemovalOfCoveringScreen:function(){var e=r("#js-hidegallery");e.length&&window.setTimeout(function(){e.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){e.remove()}),t.can("CssTransition")||e.remove(),e.addClass("hidden-content--visible")},0)},handleTurningHiddenButtonsOff:function(){this.enableHiddenButtons=!1},handleTurningHiddenButtonsOn:function(){this.enableHiddenButtons=!0},handlePictureSlidingRight:function(){this.paginate("right"),this.changeImage()},handlePictureSlidingLeft:function(){this.paginate("left"),this.changeImage()},handlePictureViewerLoaded:function(t){this.toggleViewer(t),this.createGalleryHeadline(),this.shareTools=this.pictureViewer.find(".share"),this.handleBackButtonFunctionality(),this.pictureViewer.on("click","#js-prev-picture",r.proxy(this.handleMovingToPrevPicture,this)),this.pictureViewer.on("click","#js-next-picture",r.proxy(this.handleMovingToNextPicture,this)),this.pictureViewer.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",r.proxy(this.updatePaginationText,this)),r(document).on("keydown",r.proxy(this.emitKeyEvents,this)),r(".picture-viewer__button--captions").on("click",r.proxy(this.handleTogglingCaptions,this)),r(".picture-viewer__show-image-only").on("click",r.proxy(this.handleTogglingUI,this)),r(".picture-viewer__button--grid").on("click",r.proxy(this.handleGoingBackToTheGrid,this)),r(".share__button").on("click",r.proxy(this.handleTogglingShareToolsVisibility,this)),i.find("#picture-viewer .shortenUrl").bindEvents(),e.pubsub.emit("pictureViewer:loadcomplete",[t])},emitKeyEvents:function(t){37===t.keyCode?e.pubsub.emit("key:left"):39===t.keyCode?e.pubsub.emit("key:right"):27===t.keyCode?e.pubsub.emit("key:escape"):13===t.keyCode&&e.pubsub.emit("key:enter")},handleTogglingCaptions:function(){this.shareTools.hasClass("share--visible")&&this.shareTools.hasClass("share--sliding")&&this.handleTogglingShareToolsVisibility(),this.pictureViewer.toggleClass("hide-captions"),this.toggleCaptionButtonText(),this.statsCaptionButton()},handleTogglingUI:function(){this.enableHiddenButtons&&(this.pictureViewer.toggleClass("show-image-only"),this.statsShowImageOnlyButton()),this.enableHiddenButtons=!0},handleMovingToPrevPicture:function(e){this.handlePaginateEvent(e,"left")},handleMovingToNextPicture:function(e){this.handlePaginateEvent(e,"right")},handleGoingBackToTheGrid:function(e){this.toggleViewerVisibility(),this.toggleViewerEvent(),this.setHash(""),this.statsBackButton(e)},handleBackButtonFunctionality:function(){var e=r(".picture-viewer__button--back");1===this.global.history.length?e.remove():e.on("click",r.proxy(this.goBack,this))},goBack:function(){this.global.history.back()},handleTogglingShareToolsVisibility:function(){!this.pictureViewer.hasClass("hide-captions")&&this.shareTools.hasClass("share--sliding")&&this.handleTogglingCaptions(),this.shareTools.toggleClass("share--visible")},bindEvents:function(){e.pubsub.on("gallery:picture:click",r.proxy(this.processPictureViewer,this)),e.pubsub.on("pictureViewer:open",r.proxy(this.handleRemovalOfCoveringScreen,this)),e.pubsub.on("touch:move",r.proxy(this.handleTurningHiddenButtonsOff,this)),e.pubsub.on("touch:end",r.proxy(this.handleTurningHiddenButtonsOn,this)),e.pubsub.on("touchmove:left",r.proxy(this.handlePictureSlidingRight,this)),e.pubsub.on("touchmove:right",r.proxy(this.handlePictureSlidingLeft,this)),e.pubsub.on("pictureViewer:loaded",r.proxy(this.handlePictureViewerLoaded,this)),e.pubsub.on("key:left",r.proxy(this.handleMovingToPrevPicture,this)),e.pubsub.on("key:right",r.proxy(this.handleMovingToNextPicture,this)),e.pubsub.on("key:escape",r.proxy(this.goBack,this)),e.pubsub.on("key:enter",r.proxy(this.handleTogglingCaptions,this))},setPictureClasses:function(e,t){this.imageContainers.removeClass("picture--before-current"),this.imageContainers.removeClass("picture--current"),this.imageContainers.removeClass("picture--after-current"),this.imageContainers.eq(e).addClass("picture--before-current"),this.imageContainers.eq(this.currentPictureNumber).addClass("picture--current"),this.imageContainers.eq(t).addClass("picture--after-current")},setImages:function(){var e=this.getPrevPictureNumber(),t=this.getNextPictureNumber();this.prevImage=this.images.eq(e)[0],this.image=this.images.eq(this.currentPictureNumber)[0],this.nextImage=this.images.eq(t)[0],this.setPictureClasses(e,t),this.setHash(this.currentPictureNumber+1)},changeImage:function(){this.setImages(),this.handleImageCalculations(),this.replaceDivWithImage(this.prevImage,this.getPrevPictureNumber()),this.replaceDivWithImage(this.image,this.currentPictureNumber),this.replaceDivWithImage(this.nextImage,this.getNextPictureNumber()),this.handleImageCalculations()},checkTouchSupport:function(){t.is("TouchDevice")||r("body").addClass("no-touch")},withinValidRange:function(e){return e>0&&e<=r(".photo").length},updateShareToolsUrl:function(){var e=this.stripHashCharacter();this.pictureViewer.find(".share__tool a").each(function(t,n){var o=n.href.replace(/%23$|%23\d+$|$/i,"%23"+e),i=n.getAttribute("data-target-url"),s=i?i.replace(/#$|#\d+$|$/i,"#"+e):null;n.href=o,n.setAttribute("data-target-url",s)})},stripHashCharacter:function(){return this.global.location.hash.slice(1)},checkHash:function(e){e=this.stripHashCharacter(),e=this.global.parseInt(e),this.withinValidRange(e)&&this.processPictureViewer(e,r("h1").html())},setHash:function(e){this.global.location.replace("#"+e),this.updateShareToolsUrl()},checkDevice:function(){t.is("IE10")&&r("body").addClass("ie10"),t.is("WindowsPhone")&&r("body").addClass("windows-phone")},init:function(e){this.global=e||window,this.doc=this.global.document,this.checkDevice(),this.pictureViewerRequested=!1,this.enableHiddenButtons=!0,this.currentPictureNumber=0,this.checkTouchSupport(),this.bindEvents()}};return s=n.debounce(function(){c.setImageDimensions(c.prevImage,c.calculateDimensions(c.prevImage))},100),a=n.debounce(function(){c.nextImage&&c.setImageDimensions(c.nextImage,c.calculateDimensions(c.nextImage))},100),c}),define("module/pictureGallery",["module/bootstrap","deviceInspector","vendor/lo-dash/lo-dash","module/pictureViewer"],function(e,t,n,o){var i,s=e.$,a={setConfigProperties:function(){var n=e.config.features2&&e.config.features2.rtl?"margin-right":"margin-left";this.threshold="smart"===t.getType()?150:200,this.gutter=parseInt(s(".photo").eq(0).css(n),10),this.containerWidth=s("#js-photos").width()},getImages:function(){return s(".photos img")},getListOfImageRatios:function(e){return s.map(e,function(e){return e=s(e),{element:e[0],ratio:e.attr("width")/e.attr("height")}})},addArrayElements:function(e){for(var t=0,n=0;nn&&(o=this.calculateRowHeight(t,n),i=e.splice(0,s),this.setRowHeight(i,o),this.processImageRowsRecursively(e)),s+=1;e.length&&this.setRowHeight(e,this.threshold)},calculateImages:function(){var e=this.allImages.slice(0);this.processImageRowsRecursively(e),s("#js-photos").addClass("grid-layout-complete")},storeImage:function(){a.loadedImages.push(this),e.pubsub.emit("image:stored")},processLoadedImages:function(){for(var e;e=this.loadedImages.shift();)s(e).addClass("image-loaded")},isImageCached:function(){this.complete&&s(this).trigger("load")},checkHash:function(){window.location.hash&&e.pubsub.emit("pictureGallery:hashchange",[window.location.hash])},bindEvents:function(){e.pubsub.on("image:stored",s.proxy(this.processLoadedImages,this)),e.pubsub.on("pictureGallery:hashchange",s.proxy(o.checkHash,o)),s(".photos img").one("load",a.storeImage).each(this.isImageCached),s(".photos img").on("click",function(){e.pubsub.emit("gallery:picture:click",[this.getAttribute("data-photo-no"),s("h1").html()])}),s(window).on("resize",i),e.pubsub.on("pictureViewer:open",s.proxy(function(){s(window).off("resize",i)},this)),e.pubsub.on("pictureViewer:close",s.proxy(function(){this.setConfigProperties(),this.calculateImages(this.allImages),s(window).on("resize",i)},this))},init:function(){o.init(),this.loadedImages=[],this.allImages=this.getListOfImageRatios(this.getImages()),this.imageCount=this.allImages.length,this.setConfigProperties(),this.calculateImages(),this.bindEvents(),this.checkHash()}};return i=n.debounce(function(){a.setConfigProperties(),a.calculateImages(a.allImages)},50),a}),define("module/pulseSurvey",["config"],function(e){function t(e){return 0===Math.floor(Math.random()*e)}function n(){return!!document.getElementById("bbccookies-prompt")}function o(){return 0===document.cookie.indexOf(d)||-1!==document.cookie.indexOf("; "+d)}function i(e,t){var n=document.getElementById(e);n.addEventListener?n.addEventListener("click",t,!1):n.attachEvent&&n.attachEvent("onclick",t)}function s(){var e,t=new Date;t.setDate(t.getDate()+u),e=d+"; expires="+t.toGMTString()+"; path=/"+c+"; domain=",document.cookie=e+"bbc.co.uk;",document.cookie=e+"bbc.com;"}function a(e){var t,n,o=document.createElement("div");switch(c){case"news":n=(e?p:h).replace("{siteid}",l);break;case"arabic":n=m;break;case"hausa":n=f;break;case"hindi":n=g;break;case"mundo":n=v;break;case"persian":n=b;break;case"portuguese":n=y;break;case"russian":n=w;break;case"serbian/cyr":n=_;break;case"serbian/lat":n=k;break;case"thai":n=C;break;case"turkce":n=x;break;case"zhongwen/simp":n=S;break;case"zhongwen/trad":n=T;break;case"urdu":n=P;break;default:n=E}if(t=document.getElementById("orb-pulse-tmpl").innerHTML.replace("","").replace(/\{\{pulseaccepthref\}\}/g,n),o.innerHTML=t,null===document.getElementById("blq-pre-mast")){var i=document.createElement("div"),s=document.createElement("div"),a=document.getElementsByClassName("direction")[0];s.setAttribute("id","blq-global"),i.setAttribute("id","orb-pre-mast"),s.appendChild(i),a.insertBefore(s,a.firstChild),document.getElementById("orb-pre-mast").appendChild(o)}else document.getElementById("blq-pre-mast").appendChild(o)}function r(){i("pulse-reject",function(e){return e=e||window.event,s(),document.getElementById("pulse-container").style.display="none",e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1}),i("pulse-accept",function(e){return s(),!0})}var c,l=972352687,u=90,d="ckns_pulse=1",h="http://ecustomeropinions.com/survey/survey.php?sid={siteid}",p="http://www.edigitalresearch.com/test/?sid={siteid}&vault=_",m="https://www.smartsurvey.co.uk/s/YV2E7/",f="https://six.surveys.com/projects/UKC14000152M/start.asp",g="https://www.smartsurvey.co.uk/s/3I7SZ/",v="https://www.smartsurvey.co.uk/s/2Z8FY/",b="https://www.smartsurvey.co.uk/s/0KYX1/",y="https://www.smartsurvey.co.uk/s/BPRTN/",w="https://www.smartsurvey.co.uk/s/ZJO7W/",_="https://www.smartsurvey.co.uk/s/TF4PS/",k="https://www.smartsurvey.co.uk/s/F6Z37/",C="https://www.smartsurvey.co.uk/s/6BZ7X/",x="https://www.smartsurvey.co.uk/s/8NWLL/",S="https://www.smartsurvey.co.uk/s/V6G0N/",T="https://www.smartsurvey.co.uk/s/BRU7C/",P="https://www.smartsurvey.co.uk/s/2KR4X/",E="https://www.smartsurvey.co.uk/s/AERYR/";return{init:function(i,s){c="zhongwen"===i||"serbian"===i||"ukchina"===i?i+"/"+e.languageVariant:i,"getElementById"in document&&"cookie"in document&&(s.override||!o()&&!n()&&t(s.probability))&&(a(s.override),r())}}}),define("module/responsiveIframe/iframe",["module/bootstrap"],function(e){var t=e.$,n=e.pubsub;return{updateFrequency:100,createIframe:function(e){var o=location.host.match(/bbc.co.uk|bbc.com/);o&&(document.domain=o[0]);var i=t("#"+e+" a"),s=i.attr("data-iframe-src"),a=i.attr("id");this.iframe=t("